System and method for provisioning a mobile software application to a mobile device

ABSTRACT

A provisioning system of a first party provisions a mobile software application to one or more remotely-located mobile computing devices, each mobile computing device running a same device-native mobile operating system. The mobile software application may include executable program code and a structured document such that the executable program code and structured document together instantiate at least a portion of the functionality provided by the mobile application. Moreover, in some embodiments, when the requested and sent mobile application is executed by a requesting mobile device, the structured document is transformed into a tree structure which when updated, updates at least in part the running state of the mobile application.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/005,992, filed Jun. 12, 2018, entitled “System and Method forProvisioning a Mobile Software Application to a Mobile Device”, now U.S.Pat. No. 10,552,520 issued Feb. 4, 2020, which is a continuation of U.S.patent application Ser. No. 15/180,144, filed Jun. 13, 2016, entitled“Methods and Systems for the Provisioning and Execution of a MobileSoftware Application”, now U.S. Pat. No. 10,372,796, issued Aug. 6,2019, which is a continuation of U.S. patent application Ser. No.14/987,971, filed Jan. 5, 2016, entitled “Methods and Systems for theProvisioning and Execution of a Mobile Software Application”, now U.S.Pat. No. 9,390,191, issued Jul. 12, 2016, which is a continuation ofU.S. patent application Ser. No. 14/819,983, filed Aug. 6, 2015,entitled “Methods and Systems for Enabling the Provisioning andExecution of a Platform-Independent Application”, now U.S. Pat. No.9,311,284, issued Apr. 12, 2016, which is a continuation of U.S. patentapplication Ser. No. 14/454,829, filed Aug. 8, 2014, entitled “Methodsand Systems for Enabling the Provisioning and Execution of aPlatform-Independent Application”, now U.S. Pat. No. 9,135,227, issuedSep. 15, 2015, which is a continuation of U.S. patent application Ser.No. 13/609,522, filed Sep. 11, 2012, entitled “Methods and Systems forEnabling the Creation and Management of a Platform-IndependentApplication”, now abandoned, which is a continuation of U.S. patentapplication Ser. No. 12/691,721, filed Jan. 21, 2010, entitled “UserInterface, Operating System and Architecture”, now U.S. Pat. No.8,307,331, issued Nov. 6, 2012, which is a division of U.S. patentapplication Ser. No. 10/659,762, filed Sep. 10, 2003, entitled “UserInterface, Operating System and Architecture”, now abandoned, whichclaims priority from, and is a nonprovisional of, both U.S. ProvisionalPatent Application Ser. No. 60/409,483, filed on Sep. 10, 2002, andentitled “User Interface, Operating System and Architecture” and U.S.Provisional Patent Application Ser. No. 60/428,163, filed Nov. 21, 2002,and entitled “User Interface, Operating System and Architecture”, all ofwhich are hereby incorporated by reference.

BACKGROUND

In recent years, the mobile computing marketplace has been flooded withsmaller and faster personal devices. These next generation handhelds,cell phones, automotive telematics and personal information devicessport high resolution screens in excess of 320 by 240 pixels, processorsfaster than 300 MHz, and more than 16 Mbyte of dynamic RAM. New cellphones already in the marketplace combine traditional cellulartechnology with the power of a small personal computer. Future deviceswill create brand new breeds of handheld personal computers withunparalleled power, mobility, and battery life.

Despite these impending revolutions in device capability, the market hasfailed to produce common, underlying standards for mobile interfaces.Even in this nascent stage of device adoption, it is clear to industryobservers that the wireless application market has become fragmented.JAVA-based technologies such as J2ME have been stymied with high hurdlesto application qualification and numerous manufacturer-specificadditions. MICROSOFT.NET technology, while promising, has been slow togrow on non-Intel platforms. Binary-based solutions like SYMBIANOS andBREW have failed to develop traction in a cautious market. Competingstandards and interests in the industry among carriers, devicemanufactures, technology vendors, operating system vendors andapplication developer continue to plague the industry.

Several significant hurdles obstruct easy development of rich, widelydeployable applications that run (at least partially) natively on adevice:

Multiple platforms require porting code to a variety of different APIstandards. Even within a single architecture specification, differentplatforms have slight variations that require extensive testing andmodification.

Competing languages (primarily C and JAVA) have no easy portingrelationship.

Service operators have created qualification hurdles that requireexpensive certification tests for applications before they can bedeployed on a given platform.

The industry has yet to agree on a common distribution mechanism forapplications. Consequently, getting the application onto multipledevices becomes extremely difficult.

Various sets of interests must be satisfied before these devices willrealize their widespread potential as business and consumer platforms:For example, end users seek a rich, easy-to-use interface and a costeffective and easy way to acquire and run mobile applications.Furthermore, they seek a user interface that is common acrossapplications. Users want some reasonable assurances about the qualityand integrity of the applications they receive. They are also interestedin making greater use of the power and flexibility of the new devices.

Carriers, mobile operators, media companies and other entities seekingto provide and distribute applications must choose a means to encourageapplication developers while maintaining their own revenue streams. Alsocarriers maintain a high concern about the security of code running onthe devices connected to their networks

Developers (whether independent or employed by software companies) needplatforms that are economically viable to develop upon, non-complicatedand connected to distribution points or mechanisms capable ofdisseminating applications widely. Many developers are small softwareshops that cannot afford to develop on multiple platforms and seekmultiple certifications from operators.

It would therefore be desirable to provide methods and structures thatwould address these concerns.

In this regard, it is worth noting that most computers in common use arebased around the general computing model established by John Von Neumannin 1945. In this model, programs are written in the form of orderedlists of instructions and stored within the main memory of a computingsystem. Variations on this design since 1945 have led to thearchitecture of modern INTEL, POWERPC and other microprocessor-basedsystems. Even the JAVA platform by SUN MICROSYSTEMS, which uses avirtual machine that runs on host platforms, uses a variation on the VonNeumann architecture.

One implication of the Van Neumann machine is an opcode-based programexecution model, in which instructions are written for the nativeprocessing language of the platform (or a virtual processing language inthe case of JAVA). These instructions consist of programming opcodesthat have varying degree of granularity. In some cases they can be assimple as very basic mathematics and memory loading and saving. In othercases, they are more advanced, where individual opcodes for objectmanipulation, memory allocation and I/O systems.

In this traditional execution model, a processor reads instructions froma memory location, decodes the instructions found there and performssome work, which may involve additional reading and writing of memorydata. When the instruction is complete, and succeeding instruction isread, either the next instruction in sequence or an instruction at thebeginning of a new sequence. In this way, complicated program behaviorcan be established through creation of algorithms, loops, conditionalstatements, etc. Those familiar with the arts of computer design areaware that modern implementations use extremely complex optimizationsand heuristics to achieve greater performance in this basic model,including Intel's Superscalar architecture.

To ease the development of programming instructions for a computerapplication, programs called compilers translate a program from ahigh-level representation available in structured text, XML or someother human-significant format to the lower level machine language ofthe underlying hardware (or emulation of hardware.) In this case, aprogramming language with certain grammatical rules is established, andprograms are written to conform to this specification. Examples ofcompiled languages include C, C++, JAVA, Fortran, and Cobol.

In the traditional execution model, programs wishing to access resourcesoutside of their memory space must use a set of conventions supported byan operating system. These conventions allow each program that runs on acomputer to access resources in a consistent and protectable manner.Such a convention may be regarded as an Application Programmer Interface(or API.) Typically, the API calls are triggered either by joining aprogram with libraries from the operating system at link-time or atrun-time, or through the low-level triggering of interrupts, processorexceptions, or special memory regions that contain significance to thehost operating system. Over time, these conventions have become quiteextensive, where the typical operating system (such as WINDOWS 2000)contains tens of thousands of application programmer interface hooks,accessible either by shared library or through compile-time insertion ofcode. These APIs are typically an arbitrary organization of computer andoperating system functionality and contain special rules. For instance,setWindowTitle( ) in WINDOWS cannot be called before a newWindowQ callhas been made. The programmer is responsible for being consistent bothto the rules of the language as well as the rules of the API.

In some cases, programs written at a high level are not compiled downinto their machine-language equivalent. Instead, a native computerprogram written in machine-language acts as a emulating processor,reading an internal representation of a current instruction, executingit and then following its own rules for the selection of a subsequentinstruction. These interpreted programming languages offer the benefitof greater flexibility for the language designer, easier implementationof a new programming language, usually at the expense of some efficiencysince the a level of translation is always in place between the hardwareprocessor and the internal instruction processor. Examples include PERL,versions of Basic, UNIX shell languages, PYTHON, etc.

Typical computer applications organize their information within theirmemory space using arbitrary data structures, which divide that spaceinto meaningful chunks of data that can be referenced implicitly by theloading and saving operations of the processor. To the computer and tothe operating system, these data structures are entirely private, andonly the continuing flow of instructions through the processor givesthese organizations any meaning. If a program wishes to save its contextand state to resume execution later, it must conform to one of twoconstraints.

It must marshal up all of its relevant data and innermost statepertinent to the resumption of the program in a meaningful way, into aprivate or publicly structured serial bundle of data and save that datato a persistent location. When the program must resume, it must obtaininformation to resurrect its internal data structures in their previousstate by decomposing the bundle of data it previously wrote. Variationson this model include placing data into a database, serial memory ringor other external structure. This strategy has the advantage that thestate of the program could be resumed on a different platform orcomputer system than the original, however the application must takeexcessive care to ensure that every piece of data has been saved in anidentifiable format.

It must save its existing buffer of memory, exactly as it was left, intoa single large snapshot, disentangle any memory references maintained bythe operating system and write the complete state of the processor todisk. A variation on this method is used by MICROSOFT's operating systemin its hibernation mode, and by the old BSD tool “undump.” This methodrequires very little work to decompose and marshal private datastructure into a secondary form, however it contains a very stringentlimitation: The application “image” can only be restored on a systemthat implements the same hardware and operating system state that theoriginal program had run on. Any differences could cause unpredictableproblems with the executable.

These complexities express themselves in the equally complex strategiescomputer programmers have used to construct computer programs that runon multiple systems simultaneously. For example, when a small, embeddeddevice needs to perform some complex processing operation on a morepowerful server, it must build a complete description of the workrequired, and then transmit it to the remote server. This involves yetanother API between the small device and the remote device (e.g., SOAP,and the like).

Thus, the Von Neumann model and the program execution models that resultfrom it, while useful and ubiquitous, present limitations that computerscientists and engineers have recognized but failed to address. Some ofthese limitations include:

Instruction Based Programming: Applications written for instantiationsof the Von Neumann architecture must write their applications in thenative (or emulated) code set of the given platform. Consequently, theability for optimization after the code has been compiled lies withinlocal heuristics usually available only to the instruction processor.Furthermore, the instructions must be processed linearly, whichencourages a procedural style of programming where program code islargely instructive instead of descriptive.

Seeding Complex Data Structures: Applications that work with andmanipulate complex nested data structures must populate those structureswith either long lists of instructions (such as the list of instructionsused to populate a user interface,) or the loading of those datastructures from some other source. Vast medications to data structuresafter they have been initialized requires algorithms to be createdwithin the program to manage the manipulations of the data. Thesealgorithms can be complex and rely on an instructive model whereby thechanges are made linearly step-by-step.

Remote Execution: Remote execution involves either migrating images of arunning program to a second location, or through the explicitmarshalling and unmarshalling of relevant computing data

State Saving: Programs that are halted and wish to save their state forresumption at a later time must use one of the two difficult strategieslisted above, each with potential drawbacks.

Private Application Structures: Applications store all of their datausing implicit data structures within their memory core. Consequently,applications that wish to share data with each other or with the hostoperating system must perform a translation into some common format(such as published data structures, or XML, or whatever.)

API Issues: Each operating system and software component must provide anapplication programmer interface to bridge data and activities betweenthe program and resources available to the computer, including the userinterface. Thus, it would be desirable to provide methods and structuresthat overcome these limitations as well.

BRIEF SUMMARY

The present invention addresses these limitations of the prior art, byproviding methods and structures, aspects of which will be referred tovariously hereinafter as “the Simple Quick Go system,” “SQGO,”“SimpleOperatingSystem,” “SimpleOS” and the like, that enable simple,cost-effective design, construction, deployment and distribution of richapplications for computing devices, particularly suited for wirelessdevices and other mobile computing devices and platforms.

One aspect of the invention provides a method for creating and managingplatform-independent applications. In one practice of the invention,this method includes: generating a platform-independent datasuperstructure defining the appearance and behavior of an application,independent of the characteristics of a digital processing device onwhich the application is to be instantiated; instantiating thesuperstructure in the device, thereby installing the application forexecution in accordance with the superstructure; updating, in responseto events (which may include events generated by the application(indicative of application state), or by user or network input),information in a segment of the superstructure; and updating, inaccordance with the superstructure segment update, the application statein the device.

In one aspect of the invention, the superstructure is an XML informationstructure. Application appearance and behavior are encapsulated withinthe superstructure, and application events are expressed to thesuperstructure via a pathway including a device-native operating system(OS) and a superstructure-dedicated OS acting as an intermediary betweenthe device-native OS and the superstructure. In this way, a definedportion of the application can be addressed and updated in response toapplication events without necessitating update of the entireapplication, and the appearance and behavior of the application can bepropagated with consistency across heterogeneous device types, to enablecross-device interoperability, replicability, and compatibility ofapplications and data with a consistency of user experience.

Among other aspects that will be discussed in detail below, theinvention also includes a programming language adapted for effectivelyconstructing, interacting with and manipulating the superstructure andthe SimpleOS.

In another aspect, the application instantiated in the device includesan associated user interface whose behavior and state are defined by thesuperstructure. In a wireless or other handheld device, the interfacecan be advantageously adapted to be manipulated by a simple four-waycontroller actuated by a user's thumbs.

In a further aspect, methods are provided for device-to-device orcross-network communications and application deployment using thesuperstructure described in detail below.

It should be noted that SimpleOS is but one implementation of thebroader concepts of the invention. An operating system with a differentdesign could also be used to implement the broad concepts describedherein, particularly that of a Superstructure-Based ApplicationEnvironment (“SBAE”). In other words, the structures and methodsdescribed and illustrated by way of example herein are but selectedimplementations of the broad concepts of the invention. Many variationsare possible and within the spirit and scope of the invention. Furtheraspects and implementation examples of the invention will next be setforth, in connection with the various drawing figures.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other objects, aspects, features, and advantages ofthe disclosure will become more apparent and better understood byreferring to the following description taken in conjunction with theaccompanying drawings, in which:

FIGS. 1A-3 are flowcharts depicting methods in accordance with theinvention;

FIG. 4 is a schematic diagram depicting a network utilizing the presentinvention;

FIG. 5 is a schematic diagram depicting a client device utilizing theinvention;

FIG. 6 is a schematic diagram depicting a server that can be used inconjunction with the invention;

FIG. 7 is a depiction of an example of the SimpleOS on a client device;

FIG. 8 is a schematic diagram depicting SimpleOS Portability;

FIG. 9 is a schematic diagram of the superstructure utilized in anembodiment of the invention;

FIG. 10 is a schematic diagram showing the organization of an object;

FIG. 11 presents an overview of a typical SQUI screen;

FIG. 12 is a screenshot of an example static application;

FIG. 13 is a screenshot of the Hello World example;

FIG. 14 is a screenshot of expression interpolation;

FIG. 15 is a screenshot relating to objects with variables;

FIG. 16 is a screenshot relating to variable incrementing;

FIG. 17 is a screenshot for the pizza ordering example;

FIG. 18 is a screenshot for text field extraction;

FIG. 19 is a screenshot showing further detail of a pizza orderingexample;

FIG. 20 illustrates metaphors in client computing; and

FIG. 21 depicts examples of various client/computing models.

BRIEF DESCRIPTION OF TABLES

Table 1 depicts a stylesheet example;

Table 2 depicts a simple object with a data tree;

Table 3 shows examples of identifiers;

Table 4 depicts examples of object data members;

Table 5 depicts defining methods for an object;

Table 6 shows a sample definition of an SQCard;

Table 7 depicts a sample frame definition;

Table 8 shows an example of defining the initial card;

Table 9 presents a static SimpleOS application example in SQML;

Table 10 shows four core programming modes;

Table 11 shows phases of the execution cycle;

Table 12 provides a synopsis of event handler modes;

Table 13 depicts the availability of modes within code contexts;

Table 14 shows an example of in-line event registration with code;

Table 15 shows in-line event registration for a method;

Table 16 shows in-line event registration to a server;

Table 17 depicts fields in a message descriptor;

Table 18 provides an example of a basic message descriptor;

Table 19 provides an example of combining in-line registrations withmessage descriptors;

Table 20 provides further detail regarding the Hello World example;

Table 21 depicts SQML tag attributes;

Table 22 shows an example of expression interpolation in text elements;

Table 23 gives an example of expression interpolation in attributes;

Table 24 shows an example of an object with a single variable;

Table 25 provides an example of an object with a string variable;

Table 26 provides an example relating to an object with a numericvariable;

Table 27 relates to an example of variable incrementing;

Table 28 provides a summary of examples of globally available variableattributes;

Table 29 relates to scalar attributes;

Table 30 relates to list methods;

Table 31 provides an example relating to the use of “This”;

Table 32 shows declaring list variables;

Table 33 depicts a pizza ordering example;

Table 34 shows building a list of objects;

Table 35 shows text field extraction;

Table 36 provides examples of mathematical expressions;

Table 37 provides an example of instance variables;

Table 38 shows method definition;

Table 39 provides an example of evaluation tags in a method;

Table 40 shows method invocation;

Table 41 provides method invocation examples;

Table 42 shows variable masking;

Table 43 shows variable masking with element identifiers;

Table 44 provides examples of declaration order;

Table 45 shows blocks and variable scope;

Table 46 provides an example of an IF block;

Table 47 shows further detail of the pizza ordering example;

Table 48 gives an example of the body of a message;

Table 49 provides a summary of intrinsic methods;

Table 50 shows an example of serialized data;

Table 51 shows using fragments to update an application;

Table 52 relates to nodes;

Table 53 provides a summary of security threats and responses;

Table 54 provides a simple stylesheet example;

Table 55 shows a complex stylesheet example; and

Table 56 provides a comparison of remote computing paradigms.

DETAILED DESCRIPTION

The following detailed description of the invention is organized intothe following sections:

I: Overview

II: SimpleOS Software Concepts

III: Composition of the Superstructure

IV: Programming SimpleOS Applications

V: SQScript Language

VI: Superstructure Operations

VII: Network Communication and Remote Execution

VIII: Security

IX: Stylesheets

X: Additional Features

I. Overview

In one aspect, the invention provides a method for enabling the creationand management of platform-independent applications. In one practice ofthe invention, the method (see FIG. 1A) can include generating aplatform-independent data superstructure defining the appearance andbehavior of an application independent of characteristics of a digitalprocessing device on which the application is to be instantiated (101),instantiating the application-defining superstructure (and thereby theapplication) on a device in accordance with the superstructure so thatit can then be activated or run (102); validating the superstructure(103); generating operations (i.e., running the application) in thedevice to carry out the behavior defined or described by the currentsuperstructure, thereby generating events (104); providing (by way ofthe user or a network) additional events (105); receiving the events,updating the superstructure in accordance with the events, and executinga handler (local or remote) which may update the superstructure (106);repeating the cycle by returning to validation (103); and asappropriate, updating, in accordance with the superstructure update, theapplication state in the device (108). These aspects are described ingreater detail below.

In one practice of the invention, the superstructure is a hierarchicalinformation structure (see FIGS. 9 and 10, discussed in greater detailbelow). More particularly, the superstructure can be an XML structure.Application appearance and behavior are encapsulated within thesuperstructure, and application events are expressed to thesuperstructure via a pathway including a device-native operating system(OS) and a superstructure-dedicated OS acting as an intermediary betweenthe device-native OS and the superstructure (FIG. 1A, 106). In this way,a defined portion of the application can be addressed and updated inresponse to application events without necessitating update of theentire application, and the appearance and behavior of the applicationcan be propagated with consistency across heterogeneous device types, toenable cross-device interoperability, replicability, and compatibilityof applications and data with a consistency of user experience.

In a further aspect of the invention, the superstructure can beserialized in whole or in part at any time (101).

A method according to the invention can also include (see FIG. 1B)generating a message containing a data object of a defined type operableto instantiate the application in a device (110), transmitting themessage to a device operable to instantiate the application inaccordance with the data object (112), receiving the message at thedevice (114), and instantiating the application in the device inaccordance with the data object in the received message (116). Theinstantiating of the superstructure inside the target device can occursubstantially when the application is invoked, or at an applicationprovisioning time prior to application run-time (116).

In a further aspect of the invention (FIG. 1C), a provisioningapplication on a first device can locate within its operatingenvironment a first superstructure for a new application superstructureto be expressed to a second device (118). The provisioning applicationcan then generate a defined data object to be used to express the newapplication superstructure to the second device (120). The data objectis transmitted to the second device via a message (122), and the seconddevice creates a new application superstructure from the data object inthe message (124). (In accordance with the invention it is contemplatedthat the latter can be accomplished by any operating system, or bySimpleOS.)

Alternatively, the provisioning application on a first device can locatewithin its operating environment a predefined data object that expressesa new application superstructure for a second device (118). Thepredefined data object can then be transmitted to the second device viaa message (120), and the second device creates its own copy of the newapplication superstructure from the data object in the message (122,124). (Here again, in accordance with the invention it is contemplatedthat this latter can be accomplished by any operating system, or bySimpleOS.)

In a further practice of the invention (FIG. 1D), a first device canmaintain an application capable of accepting input from a user to createan interactive message (126). The first application can then translatean operational portion of the message into a new superstructure-basedapplication operable to display the message, or cause interactiveoperations within the message (128); and the first application theninitiates the transmission of the superstructure of the new applicationto a receiving device (130). The transmission of the superstructure caninclude converting the superstructure into a temporary form that istransmitted, received, and decoded back into an original form on thereceiving device (130); and the receiving device can maintain anapplication that receives the superstructure in its temporary form,decodes it, and causes the message-bearing superstructure to operate,thereby rendering the message (132).

In addition, a first device can transmit to a second device a messagecontaining an application event item (140), and thereby cause the seconddevice to place the application event item into a processing queue ofthe second device (142). This can be, for example, the SimpleOSprocessing queue.

In describing the operation, function, and interpretation of thesuperstructure, it is useful to note a distinction between thesuperstructure itself (a hierarchical information structure with variousproperties) and the “grammar” of the superstructure (which, byconvention, describes a mapping between the data in the superstructure,and the behavior of an application). That mapping between data andbehavior can remain the same across implementations of SimpleOS toensure that the superstructure, and applications operating in accordancewith the superstructure, retain a consistent look and feel.

In accordance with the invention, for a given state of a selectedapplication, the organization of the superstructure can be substantiallyinvariant, regardless of the device, platform or device-native operatingsystem environment in which the associated application is instantiated,so as to maintain a consistent application appearance and behavioracross heterogeneous devices, platforms or device-native operatingsystem environments, without substantial changes in the code or datastructures of the application. The design of the superstructure candefine rules of appearance and behavior of the application that aresubstantially invariant across heterogeneous devices, platforms ordevice-native operating system environments; and substantially identicalapplication source code can be used across heterogeneous devices,platforms or device-native operating system environments. Using thesuperstructure concept, a user interface (or GUI) provided by theapplication can have a substantially identical appearance and behavioracross heterogeneous devices, platforms, or device-native operatingsystem environments. It is not simply that applications will have aconsistent appearance, but that because the superstructure maintains a“clean” abstraction around a common user interface (assisted bystylesheets as described below), this mechanism can ensure that the samesuperstructure will result in identical appearance and operation on anydevice.

In one practice of the invention, operation of the application isimplemented through operations on the superstructure. The operation(FIG. 1E) can include receiving an application event in thedevice-native OS (144), receiving data representative of the applicationevent in the superstructure-dedicated OS (146), applying to thesuperstructure, in response to the received data, a data object, therebymodifying the superstructure (148), and operating the application in thedevice in accordance with the modified superstructure (150). This canfurther include (FIG. 1F) generating a modification data objectrepresentative of the modification to be applied to the superstructure(152), translating the modification data object into a form suitable forprocessing by the device-native OS (154), receiving in the device-nativeOS the translated modification data object (156), and processing thetranslated modification data object in the application to update theapplication (158). The method can also include expressing within thesuperstructure a mechanism for generating the modification data object(152).

Still further, the step of modifying the superstructure can include(FIG. 1G) transmitting a portion of the superstructure to a processor(such as a server) remote from the device (160), modifying thetransmitted portion (162), and then returning the modified portion or anew set of operations to update the superstructure (164).

The modification process can include using device-native code toimplement an interface to modify the superstructure (148). Theapplication of changes to the superstructure can be implemented byactivating program instructions within the superstructure (148).

The invention can also be implemented in a network environment. Forexample (FIG. 1H), a copy of the superstructure can be stored on anapplication server operable to communicate with a remote device across anetwork comprising the application server, the remote device, and acommunications channel therebetween (166); the superstructure caninclude data objects operable to instantiate applications in the remotedevice (166), and the network can be configured to provide communicationof applications between the application server and the remote device byreplicating data objects in the superstructure to the remote device viathe communications channel, so as to enable instantiation of new dataobjects and applications from the server into the remote device (168).

In a network implementation of the invention, when an application eventis expressed to the superstructure (FIG. 10, a superstructure objectassociated with the application event can be transmitted via acommunications pathway from the device to a remote server (170); theserver can process the object and create a new version of it, inresponse to the application event (172); the new version of the objectcan be transmitted from the server to the device to replace the existingversion of the superstructure object, thus updating the superstructure(174); and the superstructure-dedicated OS can cause the device-nativeOS to update the application state in response to the updatedsuperstructure (176).

The described methods can also include providing updates to anapplication's state from the server to a remote device, by defining aminimal change set to the application's state and transferring it acrossthe network from the server to the remote device, without the necessityof adapting code therefor.

Similarly, application logic can be distributed across the network byobtaining a portion of the logic from the remote device and transmittingit in a hierarchical form to the server without the necessity ofadapting code therefor.

It is contemplated that the network can include a plurality ofheterogeneous devices, communications channels and communicationsproviders servicing the communications channels. (See, for example,FIGS. 4, 5, 6, and 7, which depict examples of a network using theinvention, a client device, a server, and SimpleOS on a client device,respectively.) In such an instance, the superstructure can define agiven application to have an appearance and behavior that can bepropagated with consistency across the heterogeneous devices,communications channels and communications providers, to enablecross-device interoperability, replicability, and compatibility ofapplications and data with a consistency of user experience. Inparticular, the superstructure can be substantially free ofdevice-specific data, modifications to the superstructure can be made ina substantially device-independent manner, and a real-time image of anapplication running in a first device can be expressed across thenetwork from the first device to a second device to yield a viableinstantiation of the application in the second device, regardless ofdevice environment, wherein the organization of the superstructure andthe meaning of objects within it remains substantially constant betweeninstantiations in various device environments. Note that (as discussedin detail below) the superstructure is capable of completely expressingthe running state and functionality of an application operating in afirst device, and the application can be substantially identicallyinstantiated into a second device, without loss of state orfunctionality, by expressing the superstructure into the second device.(It will be appreciated by those skilled in the art that the implementercan ensure this property by maintaining the same convention of meaningfor interpreting the superstructure in a given device.)

Alternatively, an application defined by the superstructure can betransmitted via a peer-to-peer transaction from a first device in whichthe application is instantiated, to a second device for instantiation inthe second device (FIG. 1J, 178, 179).

Among other possible variations, a method according to the invention caninclude validating the superstructure upon or after modification (106,FIG. 1A). If done after modifying the superstructure, the validating caninclude validation of data updated by processing of an event, so thatthe modified superstructure cannot express a harmful change to thedevice-native OS. The method can be configured such that an applicationdefined by the superstructure can produce external changes only byinvoking operations that operate on the superstructure, thus enhancingsecurity. (This is described in greater detail below.) The methods ofthe invention thus provide (among other features) an interface betweenan application and a system service, wherein the interface is defined byinteraction between the superstructure and the superstructure-dedicatedOS.

Another aspect of the invention is an information processing languageadapted to interface with the structures (and superstructures) describedabove, wherein the language (1) can be expressed entirely within thesuperstructure, and is capable of (2) expressing a set oftransformations within the superstructure, and (3) of utilizing andmodifying data only within the superstructure. In this way, applicationsutilizing the language cannot affect the state of other applications oroperate outside a bounded application container to affect an underlyingdevice platform. This organic, structural feature further enhancessecurity.

A superstructure can also contain stylesheets (910, FIG. 9) for definingselected application or presentation characteristics. These stylesheetscan be configured on a per-device basis, or on a per-group-of-devicesbasis. Stylesheets can also be expressed within the superstructure,independent of device-specific limitations. A stylesheet can then beselected at application runtime. This helps resolve the need to presenta consistent look and feel for the superstructure across devices withdifferent characteristics, without the need to embed device-specificlogic into the design of the superstructure itself.

The invention can also include (FIG. 1K) converting at least a portionof the superstructure into a device-portable form, independent of thepresent state of the application (180), and reconstructing the originalsuperstructure portion, on the same or different device context, usingthe device portable form, without loss of state (182). Thisreconstructing can include using a new device-specific stylesheet. Thedevice-portable form can be used as an intermediate or permanent storageformat for recording data within the superstructure (182).

Among other variations of the methods and structures described herein,the superstructure can be organized into objects and classes (904, 906,908, FIG. 9, described in detail below). The superstructure can alsocontain data structures adapted to be interpolated, and interpolationcan occur whenever a device-native operating system requests data fromthe superstructure. The described methods can also include incorporatingmedia assets into the superstructure, for reference by runningapplications, and/or incorporating by reference media assets outside thesuperstructure, for reference by running applications.

In another aspect, the application instantiated in the device includesan associated user interface (GUI 502, FIG. 5) whose behavior and stateare defined by the superstructure. In a wireless or other handhelddevice, the interface can be advantageously adapted to be manipulated bya simple four-way controller, of known design, actuated by a user'sthumbs (512, FIG. 5).

As described in greater detail below, the example of an SBAE operatingsystem known as SimpleOS is adapted to run on otherwise conventionalapparatus such as handheld processing devices (Personal DigitalAssistants (PDAs) or others), laptop computers, desktop computers orother known microprocessor-based systems, such as those shown in FIGS.4, 5, 6 and 7, which typically include conventional processingcomponents such as RAM, ROM, CPU and bus elements.

For example, FIG. 4 shows a network in which the invention can operate,including a conventional server 404 of known design and function,operable to communicate with conventional information storage elements402 and a conventional inter-network or communications channel (such asthe Internet, World Wide Web, or other) 408. Inter-network 408 isoperable to communicate, in a known fashion, with client devices 410,which as shown in FIG. 4, can include (but are not limited to) aconventional cellphone, PDA, laptop computer, and desktop computer (suchas an IBM Personal Computer or equivalent). By way of example, thecellphone can include a conventional 4-way controller of the type havingarrow keys and a central “actuate” key, as well as other thumb-actuatedkeys below. These physical control elements, which are shown in greaterdetail in FIG. 5, are used, in one practice of the invention, to provideinput to a GUI that can be instantiated, maintained, modified andupdated by SimpleOS, examples of which are shown and described inconnection with FIGS. 11-19 below.

Similarly, FIGS. 5 and 6 show examples of a conventional client device500 (cellphone, PDA or other device of the type represented by element410 in FIG. 4) and a conventional server 600 (of the type represented byelement 404 of FIG. 4), respectively, operable in accordance with theinvention. The client device 500 of FIG. 5 is typically conventional indesign and construction, including RAM 504, ROM 506, a CPU 508, a bus510, GUI 502, and 4-way controller keys 512. In accordance with theinvention, the instantiation, operation, maintenance, and updating ofapplications (and the GUI) can be controlled by SimpleOS 514 asdescribed below. The interaction between the 4-way controller, SimpleOS,applications, and the GUI is also described below.

The server 600 of FIG. 6 is also typically conventional in design andconstruction, including such components as RAM 602, ROM 604, CPU 606,and Storage 608, collectively operable to communicate applicationsand/or data to and from the network.

FIG. 7 shows the relationship between SimpleOS 706 (in connection withan example of an SBAE in accordance with the invention), a device-nativeoperating system 702, and an application 704 in a client device 700.This relationship is described in greater detail below. Similarly, inthe examples of each client device shown in FIG. 4, SimpleOS isoperating to receive and process applications and data 406 as describedbelow.

II: SimpleOS Software Concepts

In one embodiment, SimpleOS is optimized for the deployment of taskdriven (and usually, network-aware) applications with a focus on easyuser interactivity, sound, and a four-function user interface. The majorgoal of the SimpleOS design is to produce a way to create a client-sideapplication optimized for a small mobile device that can be developedand tested on many individual device platforms without a lot of extrawork. The operating system includes many features in its design toaddress the shortcomings of other mobile technologies and allowapplications to be secure, easy to develop and easy to distribute amonga variety mobile operators.

Although the programming model set forth herein is entirely differentfrom previous industry designs, it does share a common feature with manyplatform-independent environments in that it achieves its portabilitythrough the creation of a well-defined interface. SimpleOS places anabstraction layer on top of a host operating system such as JAVA, BREW,or WINDOWS that allows all operating system resources to be consistentlyaccessed by an application program described in XML. However, SimpleOSdoes not follow the model of WAP or UIEvolution where programs areeither document-based or procedure-based. As will be demonstrated later,SimpleOS is a blend between document and descriptive-based programmingand procedural object-oriented programming.

The Superstructure: A central SimpleOS feature is the concept of thesuperstructure, a unifying data structure that contains the state,program code, and internal logic of each application. All of the aspectsof a program that would normally be controlled through private datastructures, procedural code, and application programmer interfaces areincorporated into the superstructure.

Note that the superstructure can also contain data in a private formdetermined by the execution environment, separate from the “public”aspects of the superstructure viewable by the application.

Additionally, while the superstructure may be represented as a DocumentObject Model (DOM), its properties while running a SimpleOS-basedapplication are significantly different. The operating system actively“watches” the superstructure as it changes in accordance withapplication state, and is optimized to accommodate small running changesto its hierarchical structure. Further, the operating system takes anactive role in updating the superstructure and in triggering applicationhooks (which can also be stored within the superstructure) as a resultof activity outside of the application. When a superstructure-basedapplication is not running, or is paused, its entire state can betransferred into an XML object via a DOM or other means.

It is also significant that the SimpleOS model in part builds on anestablished concept in the art of XSLT transforms, where documents ofone grammar are transformed to documents of a new grammarprogrammatically. However, SimpleOS's use of this building block is new.SimpleOS uses a transformation language similar to XSLT to manipulateparts of a superstructure entirely within the same grammar, and providesa constant “feedback loop”, in which the output of the transformation isapplied back into the superstructure causing operating system changes,and then fed back into the transformation again during the next event.To the extent these similarities are maintained in one practice of theinvention, it is because they render it convenient for expressingchanges to tree structures. The syntax of other languages and/orgrammars could be used equivalently.

Product and Implementation: As a product, SimpleOS will appear assoftware that runs as a native program in a host operating system. Itruns along with other provisioned applications on the device, andappears as a single application. However, the SimpleOS software isreally a container for a collection of SimpleOS applications that runinside of it (i.e., an application “player” similar to a Flash player orJAVA Runtime Environment). The host operating system can include any Cor JAVA based operating system including BREW, J2ME, PALMOS, WINCE,STINGER, WINDOWS, MACINTOSH, and LINUX. To these host operating systems,SimpleOS appears as an application that can be run in the givendevice—for instance, a .PRC in PALMOS or an .EXE in WINDOWS. In certainsituations, SimpleOS can be configured so that applications inside ofthe container appear as though they are “peers” to other non-SimpleOSapplications on the device. However, when the user activates theseapplications, they will internally run inside a single instance of theSimpleOS native application.

Isolated, Strong Container: SimpleOS provides an isolated container thatprotects all running SimpleOS programs from the host environment.SimpleOS uses a strong security design that emphasizes a completeinterface firewall between an application and the host environment.Within SimpleOS, a developer's code may only access a central,well-protected document structure (the superstructure) as a means tomanipulate its environment. All of the functionality that would normallybe described using library or API calls is completely hidden from theapplication. In fact, it would be impossible for the application's codeto perform any work other than to modify the application's own datastructure. The document structures forming different SimpleOSapplications are completely isolated from each other.

Consistent Interface to Multiple Platforms: The attached FIG. 8summarizes how SimpleOS will provide a consistent interface to multipleplatforms by plugging into the various API signatures of its hostenvironment.

As shown in FIG. 8, SimpleOS implementations can be developed on avariety of mobile and desktop platforms 802, 804, 806, 808 using the Cor JAVA language. In most implementations, the actual code of theSimpleOS product can be divided into platform-specific andplatform-general code. This can enhance the potential for reuse of codewithin a particular programming language since different environmentscan swap in their own platform-specific set. For example, early versionsof SimpleOS based in the C programming language contained the corefunctionality written in 100% pure ANSI C that did not contain anyoperating system calls, I/O functionality, or floating-point code. A setof adapting modules allows this platform-neutral component to run on avariety of real platforms such as WIN32 and BREW.

Durable Abstraction Layer: SimpleOS creates a durable abstraction layerover a host operating system that allows programs to be written in aplatform-independent way, since the basic document structure thatgoverns each application is substantially similar, not matter whatplatform it is running on. One practice of the invention expresses theinitial state and application code of the application using an XMLgrammar called SQML. SQML, like HTML, is a textual document format thatallows information to be represented in a platform-independent way.However, unlike HTML, which was designed only to represent documents,SQML is designed to represent an entire SimpleOS program. Like JAVA,SimpleOS simplifies application development by providing a consistentplatform across many host operating systems. However, unlike JAVA whichachieves cross-platform consistency by means of a universal machinelanguage, SimpleOS achieves cross-platform consistency by its use ofSQML

SimpleOS introduces a paradigm shift away from the traditionalprogramming style of programming languages and application programmerinterfaces and toward a model in which the entirety of theapplication—the program code, application data and networkcommunication—is completely described and operated upon using SQML.SimpleOS's brand-new model of computing is based aroundtree-manipulations and the complete removal of application programmerinterfaces. The heart of this model is the superstructure, a datastructure that resides at the core of SimpleOS processes.

It will be appreciated that other portable hierarchical andnon-hierarchical structures may exist that could convey an applicationwith the properties described herein, other than an XML structure, or atree structure with the SQML grammar described by way of example herein.However, SQML itself, and in relation to a running SimpleOS program,enables a number of implementation-specific optimizations that allowSimpleOS to be better understood by users and more compatible with othersystems or technologies that may need to interact with it. It should benoted, at any rate, that SQML could take a number of different forms,other than those illustrated below by way of example.

Superstructure Operations

The superstructure is more than just a data structure—it is the entiredynamic state of the running program, including all of its program codeand data. The superstructure not only organizes the program code anddata, but it also governs the execution model of the entire application.As the program runs, the superstructure evolves and changes dynamicallyas an exchange between the operating system and the application. Theoperating system translates external events, such as user interaction,into changes to the data values within the superstructure and activatesapplication code also located within the superstructure. When theapplication code reacts to a change, it responds by updating parts ofits own central structure. When the operating system observes theseschange to the superstructure, it invokes services and library calls onbehalf of the application. This intermediate step provides additionalopportunities for verifying the request and optimizing it, and helpscreate an “interface firewall” between the application and SimpleOS. Theoperating system is free to choose whatever sequence or action must betaken to implement the change as it is described, freeing the programfrom any explicit knowledge of the particulars of the current hostoperating system.

The superstructure is thus the common ground between the operatingsystem and the running application. The operating system is not requiredto maintain private state or data structures about the application'sprevious interactions since the two do not maintain any conversationalinterfaces such as API calls. The data that forms the specific sharedassumptions between the application and the operating system existentirely within the superstructure itself. This approach is entirelydifferent from the traditional API or library interface model ofprogramming that relies on application-private and operating-systemprivate state to provide a barrier and retain the “conversation.”Nothing in the present invention, however, prevents the ability tomaintain private state if desired or useful.

Tree Structure Manipulations: Because the superstructure is a tree,application code preferably can be restricted only to operations thatinvolve manipulating trees. All outside data is delivered in the form ofa tree, and external changes to an application occur exclusively as aresult of tree operations. Consequently, application code is basedentirely around tree transformations, and the work done by theapplication is descriptive. There is no explicit application programmerinterface (API) needed for SimpleOS programs. However, an API can stillbe employed if desired, and the nature of the present invention allowsthe possibility of using an API. For interactions that are based more on“verbs” as opposed to descriptions, such as low-level network orphysical events (such as ejecting a disk), the descriptive approach maybe less compelling.

Traditional Models Vs. SimpleOS

In the traditional programming model, the programmer writes code using aprogramming language that is compiled into the native instruction set ormachine code of the target platform. In the case of byte-codeinterpreted languages like JAVA or Perl, the machine code that resultsfrom compilation is not the machine code of the native hardware, andfurther translation or interpreting is necessary for execution of thecode. The programming language itself typically only supports programdecision-making, mathematical operations, control-flow, and othercomputing fundamentals. In order to perform anything beyond purecomputation, the programmer uses a platform-specific library of externalApplication Programmer Interface (API) calls to perform functions notprovided by the programming language. These functions typically includesuch operating system functions as file input/output, memory managementand process control, as well as functions provided by a program library,for example a graphics library. Therefore, within the traditionalprogramming model there is an abstraction barrier between theapplication and the operating system based on the operating system'sAPI.

Traditionally, the operating system's API acts as an intermediarybetween the state and assumptions of the operating system itself and theinternal state the application. The operating systems own data is hiddenfrom the application, often in a protected area of memory. The API isthe only means for the application to change the state of the operatingsystem. The API may be thought of as a set of services that theoperating system provides to its applications.

In existing programming environments, the API is needed to enforce theseparation of state between the assumptions and data space of theapplication and its host operating system. Typically, the applicationmanages its own data structures by dividing its binary address spaceinto areas implicitly separated by the weaving of the program code,stack frames, heap allocations, etc. Typically the programmer craftsuseful abstractions inside this private memory area to help in theoperation of the program and keep track of its conversational state withthe operating system. The operating system is completely ignorant of theprivate data structures of the application. Similarly, the operatingsystem manages its tasks by creating private data structures torepresent outside interaction and providing API calls for theapplication to modify these OS private structures as part of itsconversational state.

Note that in referring to “conversational state” herein, the applicantsrefer to the back-and-forth API calls between a traditional applicationand a traditional operating system. By way of example, consider openinga file and writing to it. In such a case, the application asks for afile handle from the operating system. The OS then allocates someprivate structures to account for the transaction on its end, and thenpasses something back to the application, called a file-pointer orstream handle, or something that the application then private stores.When the application writes to the file, it must pull up that value ornumber, and use it to reference the file with the OS. The presentinvention, in contrast, is much more like memory mapped IO, in which thefile itself is reflected into the superstructure. The application asksfor the file to be opened by setting up a node in its superstructurewith a filename. The operating system sees this new node, and maps thecontents of the file into the superstructure. The application then readsfrom it, just as if the entire file were part of the superstructure. Theadvantage of this is that using well-known techniques such as paging andbuffers, the operating system can very efficiently maintain this virtualstructure (i.e., that the entire file is part of the superstructure).

In addition, as schematically shown in FIG. 3, the operating system canuse the internal representation of the superstructure (i.e., the portionthat the application does not “see”) as a hook for placing private datarelated to the request (304, FIG. 3). The superstructure must internallybe represented as a set of objects with references, a set of structureswith pointers or the like. Either way, there is a private representationof the superstructure that the SimpleOS implementation uses to store inthe host's architecture. The noted structure can be used to store databeyond just the contents of the superstructure. It could also storeprivate information related to the particular state or data type of thenode. For example, the file-opening node discussed above could berepresented as a data structure that has a “spare field,” readable onlyby the OS, that contains the file pointer provided to SimpleOS from thehost operating system. This private data is not serialized when theapplication is paused, halted or migrated, but it provides a convenientplace to store this information that is precisely organized in anefficient manner for the SimpleOS implementation while theimplementation is running (304, FIG. 3). The result is an ability tostore non-conversational data in a completely recoverable way, so longas the private data can be re-established upon deserialization based onpublic data that has been maintained in the superstructure. This isprimarily for efficiency.

SimpleOS does not require an API because it does not allow theapplication to explicitly invoke its services. Instead, the SimpleOSoperating system acts as a constant observer to the superstructure. Whenthe application changes its superstructure, the operating systemautomatically invokes the services that are needed to perform the changein the outside world. When outside events occur, the operating systempasses them down into the superstructure by manipulating data valuesinside and providing notification to the application. The superstructurecompletely replaces the explicit invocation of outside resources in anapplication.

Another way to view the difference between SimpleOS and traditionalmodels is the structure of the code. In the traditional model, theprogram is prescriptive. Like a recipe, it provides a list ofinstructions to the operating system that prescribe a particularactivity, such as “draw a dialog box here, then add a button, thenrender some text.” In the SimpleOS model, code is descriptive. TheSimpleOS application describes the final state of what it would like tohappen (“a dialog box on the screen, with a button and some text”). Theoperating system takes this description and determines the optimal wayto implement the change

Using the superstructure concept described herein, the invention ineffect provides a way to adapt the paradigm of memory mapped 10 toaccomplish substantially every task within an operating system, notmerely file writing.

Contents of the Superstructure

The superstructure includes the entire nature of an application program.Application program code, private and public data, graphical userinterface configuration and virtually every single aspect of a programis kept together in a single, highly organized data structure containingthe shape of a tree. An application's permanent and running state isentirely defined by the superstructure, including: Every detail aboutthe user interface, including colors, text, positioning, user elements,screens, backgrounds, sounds and controls; All internal applicationstate, including local data, state variables; All client-sideapplication code, in the form of message registrations andtransformations. The composition of the superstructure is described indetail in “Composition of the Superstructure” below. For now, it isimportant to know that the superstructure is internally defined as asingle, very extensive tree that contains objects that describe thestate of the application and its interaction with the operating system.Each node inside the superstructure can contain attributes and childrennodes.

Programming Paradigm

The XML source of a SimpleOS application is not a program structure thatis interpreted or compiled. Instead, it can be the seed image of theinitial state of the superstructure. When a program is started, thisseed image populates a new superstructure for the application.

The state of the superstructure at any point in the execution of aSimpleOS process may be represented in SQML. An application's state maytherefore be captured in SQML form and transmitted or saved to a file.Or, the state of the superstructure may be represented in a morecompact, platform-independent binary format. This allows a SimpleOSprogram to be saved and resumed, or to migrate from one system toanother, without loss of continuity. Because of the equivalence of thesuperstructure to SQML, a running application process can be easilycondensed into a serial form that can be communicated across a networkor other streaming connection.

Again, SQML, as described herein, is but one grammar that could be usedto seed a superstructure. In addition, while the applicants describeherein particular examples of organizing the superstructure in SimpleOS,many different organizations could be used to provide a usefulimplementation based on the broad concepts of the invention, and arewithin the scope of the present invention.

Dynamic Sections

The actual organization of the superstructure maintains the abstractionbetween the operating system and the application. A defined contractbetween SimpleOS and the application maintains the meaning of eachsection of the superstructure based on well-defined names, types andlocations. In the illustrated embodiments, this contract is expressed aspart of the SQML grammar and the specification of SimpleOS itself. Thiscould of course be different in different implementations of theinvention. The operating system's work is directly affected by thecontent of particular sections of the superstructure, and any changes tothose sections of the superstructure effect an immediate change withinthe outside application. No API calls are required by the application toread or write data from the operating system. Instead, all operatingsystem functions are accessed by changing these “dynamic sections” ofthe tree that share common meaning between the operating system and theapplication. Again, the overarching principle is that the contract ofthe dynamic sections relates to a set of shared semantic assumptionsbetween the application and the operating system about the meaning ofeach section of the tree. The specifics of implementation, however, canvary in accordance with the implementer's design.

In essence, when an application wants to manipulate its externalinterface, it describes changes to particular parts of itssuperstructure. The operating system observes these changes to thesuperstructure, and invokes services on behalf of the application toperform the work described there. The operating system is free to choosewhatever sequence or action must be taken to implement the change as itis described, freeing the program from any explicit knowledge of theparticulars of the current host operating system.

The term “dynamic sections” is used herein to describe the elementswithin the superstructure that have shared meaning between the operatingsystem and the application. These elements are constantly observed bythe operating system for change. The “dynamic” sections of the tree aredefined by a grammar that indicates the node types, locations andattributes. The parts of the application that have “dynamic” stateinclude the nodes the represent the graphical user interface, the eventregistration, input and output, etc.

To better appreciate the implications of this organization, consider asimple example. For instance, assume a hypothetical mapping wherein anode within the superstructure named“root.gui.screen.mainScreen.myButton” represents a button that anapplication displays on the screen at startup time. The startup SQML ofthis application describes a node with this pathname and attributes thatdescribe the properties of this button, including its location, size,and color. For instance, if the application initially wants the buttonto have a blue color, it will define an attribute on this node with thename “foregroundColor” that contains a value of “blue.” The very act ofincluding this node within the superstructure will immediately cause abutton to appear on the screen when the application starts—no additionalwork is needed. Because the node exists in a “dynamic section” of thesuperstructure, it has meaning to both the operating system and theapplication, and both of them maintain its meaning through the lifetimeof the node.

Continuing the example, assume that the application would like to changethe color of the button from blue to red. The application merely has toupdate the same GUI node and establish a different value for the“foregroundColor” attribute. Immediately after this change has beenmade, the button's color will change on the screen. The reason is thatin the SimpleOS execution model, the operating system efficiently tracksthe changes made to the superstructure after every code fragment hasrun. Upon discovering that the code has changed an attribute on abutton, the operating system will verify the change and call theappropriate services on the device to actually change the visible color.

Describing Programs with SQScript In the SimpleOS technology, tomanipulate the superstructure, the application program describesmodifications to the tree using a rich expression language calledSQScript. SQScript is a powerful language that is similar in syntax toXSLT, but much more dynamic. Within SQScript it is possible to changedata values within the superstructure, including those in dynamicsections, using tree modifications and updates. As noted herein,SQScript is but one of many languages that could be used to implementthe present invention. Other XML or tree-structure-based languagescapable of implementing private variables, program control, eventhandling and tree manipulation could also be used.

Other Programming Approaches

As described later, the application may also write its code using nativelanguages on the device or over the network. See “Programming SimpleOS”below.

Application Lifecycle

As noted above, SimpleOS applications may be provisioned from an XMLgrammar that describes the initial state of the superstructure. In aSimpleOS implementation of the invention, each application stored withinthe SimpleOS container has exactly one initial state definition. Eachprovisioned application also has a unique ID that is used to manageconsistent network communication. Applications typically reside in apermanent area of memory until the user activates them. This does notnecessarily mean that all of the resources for the application have beenloaded. If desirable, the operating system can purge infrequently usedapplication resources from the device and re-load them over the networkif they are needed.

At any point in time, a running application has one or more executingprocesses. Each process has its own copy of the applicationsuperstructure, and maintains a message queue of pending operations. Ifthe developer wishes, the application can be started as many times asthe user wishes, so that a given application can have more then onerunning process. SimpleOS provides the user with a mechanism to switchbetween running processes.

In the reference implementation of SimpleOS (which is but one possibleimplementation of the invention), each process runs in its own thread,allowing true multitasking between running processes. However, it is notnecessary for the host platform to support multi-threading. Since manyof the target platforms such as BREW lack any support for threads, theSimpleOS implementation on these platforms must provide an internal formof multitasking sufficient for consistent execution behavior across allplatforms.

Developing Applications

In a particularly useful implementation of the invention, applicationsare provisioned to the operating system by conveying or transmitting a“seed” image of the application in some portable format. Thus, forexample, developing a SimpleOS application involves writing the “seed”image of the application superstructure. Outside the device, this seedimage is typically expressed in SQML, which is an XML grammar thatrepresents any type of data inside the superstructure. SQML (or whateverappropriate grammar is used to convey the superstructure) is not itselfa programming language like C or JAVA. Instead, it should be thought ofas a combination of the initial state of an application and the rulesthat show how the initial state reacts to the actions of the user. Underthis paradigm, development is akin to filling in a large tree thatorganizes different aspects of the application, clustered into objectsand classes. The developer specifies screens and controls by groupingthem into classes that are stored in the superstructure. In the SimpleOSexamples discussed below, the actual code for each handler is writtenusing a template and expression language called SQScript.

Running Applications

SimpleOS (or a similar superstructure application environmentconstructed in accordance with the invention) comprises a strongcontainer implemented on top of an existing host operating system. Inthe most basic case, SimpleOS will appear as part of a menu ofapplications available on a device, for instance as an icon on a Palm'slauncher application or an item in the WINDOW's Start menu. Once theSimpleOS container is started, it will automatically invoke a special“launcher” application, written in SQML and native platform code. Thelauncher application will query the internal storage on the device andpresent a menu of available applications. The user can browse the listof applications that have been already provisioned and choose one tolaunch. At this point, the seed image of the new application is placedin its own process, populated into a new superstructure, and launched.The application will take over the screen, initialize its functionality,and begin to receive messages from SimpleOS.

The launcher application will also support a network mode, where thelauncher can download lists of new applications and trigger theprovisioning process. Applications can even be browsed “on-the-fly” byentering a URL. In this case, they are never formally provisioned to thedevice but reside in temporary memory. This functionality allowsSimpleOS (or a similar superstructure-based technology constructed inaccordance with the invention) to support a “WAP-style” of connectedapplication browsing.

The launcher is a hybrid application, written partly in SQML and partlyin native code. It requires native support in order to perform functionsnormally disallowed by the operating system such as process andapplication control.

Provisioning Applications

SimpleOS will store a number of SQML applications in persistent storageto reduce bandwidth and latency for launching applications. Themanufacturer or the user can provision the majority of applications, inan effort to contain bandwidth and improve startup time. MobileOperators or Simple Quick GO will be able to determine a menu ofapplications available to a particular user that can be downloaded overthe network itself.

The technological approach of SimpleOS (or other implementations inaccordance with the invention) supports several desirable provisioningmodels for wireless handsets and other mobile devices. The key to theease of provisioning is the ability for the application “source,” whichis really just the seed image of the superstructure, to be expressed asSQML (or an equivalent transport mechanism). In its streamed form, sucha document can easily travel over any stream-based connection protocolincluding raw TCP/IP, HTTP, WSP, and serial connections. Several ofthese protocols, including HTTP and WSP, are supported over wirelessnetworks such as cellular, 802.11b (WiFi), and BLUETOOTH. Plannedimplementations of SimpleOS will contain support for a variety of theseprotocols. For simplicity, a present implementation of SimpleOS relieson HTTP and HTTPS, which may be layered upon other wireless or wirelineprotocols.

Typically an application will consist of SQML and some number of mediaassets such as images, sounds, graphics, animations, videos, and MIDItunes. Standards such as Internet MIME can be used to lace togetherthese different media files along with the SQML document into a singleapplication image that can be shipped to the device using networkprotocols.

Server Provisioning

In one embodiment, the present invention can provide a J2EE-basedprovisioning server to download applications to the device upon request.The provisioning server will maintain a registry of all of the devicesthat can receive applications from it, including their security keys andtheir device characteristics. The provisioning server allows forapplications and data to be transmitted securely to each terminal andfor the application data to be pre-formatted to fit the capabilities ofthe particular device. By knowing the characteristics of the device,images can be resized, sounds files can be converted, and media streamtags can be changed based on the device capability.

When the launcher application makes a request to the server for a newapplication, it will include its provisioning key with the request. Thisprovisioning key is a unique identifier for the device that was seteither at the factory or during the user's installation of SimpleOS. Theprovisioning server will perform an access check to ensure that theprovisioning key is valid, and then look up the device characteristics.Now armed with complete knowledge of the device capabilities, theprovisioning server can perform a variety of up-front tasks to improvethe application on the device. This may include:

Resizing images or adding/removing colors to suit display capabilities;

Changing the compression format of images, sounds and media to matchde-compressors found on the device;

Altering the bit-rate of sound and media formats to avoid overwhelmingthe device; and

Pre-applying style-sheets or conditional macros within program code. Theresulting SQML and associated media assets are laced together into asingle application file and returned to the device. The conversionactivity may occur on the fly when the request is issued, but for speedthe model also supports the provisioning activities as a one-timeoperation done in advance for each known device type.

On the device, the SQML and other assets will be filed inside theinternal file storage available to the SimpleOS container. Theapplication will be registered internally so that it appears within thelauncher with the appropriate icon and label.

As noted above, methods other than SQML can be used for conveying andlaunching a superstructure-based application in accordance with theinvention.

Peer Provisioning

One embodiment of SimpleOS also supports a provisioning model whereapplications are sent from peers over protocols such as 802.11b,BLUETOOTH, and Infrared. In this case, the launcher application on onedevice can send a message to the launcher application on another devicewith the content of the application. This method would also work forprovisioning kiosks, where a user simply places his device near or onthe provisioning kiosk and software within the kiosk initiates atransfer of an application to the device.

III: Composition of the Superstructure

In accordance with one embodiment of the invention, the superstructurerepresents the entire nature of a SimpleOS application program.Application program code, private and public data, graphical userinterface configuration and virtually every single aspect of a programis kept together in this single, highly organized data structure. Whenan application is launched, a new superstructure is created based on theSQML definition (seed) of the program.

Conceptually, the superstructure has a tree shape that loosely followsthe conventions of an XML Document Object Model (DOM), where each nodeis like an XML element. Each node/element may have any number ofattributes characterized by a name and string value. Nodes can be nestedaccording to the grammar of the SQML DTD, a specialized grammar thatgoverns the permissible shapes of the superstructure. It should be notedthat the SQML DTD is not the grammar of the SQScript language—it isactually the grammar of the continually updated data structure of therunning application.

However, the superstructure of the present invention differs from an XMLDOM. Unlike an XML DOM, the superstructure inherently allows groupingsof entities into objects and classes. And also unlike an XML DOM, thesuperstructure of the invention regards these grouped entity objects tohave methods, inheritance and classes that affect their data retrievaland execution properties.

For purposes of simplicity, in the examples discussed herein, theapplicants have opted to use a number of XML standards as part of theSimpleOS implementation. However, those skilled in the art willunderstand that the properties of a superstructure-based applicationprogramming environment like that of the invention transcend specificXML grammars or approaches. In particular, a superstructure-basedenvironment utilizes a hierarchical structure with a specific andcontrolled grammar to provide a consistent structure and a way toexpress the contract between the operating system and the application.XML-based technologies share some of these properties and can be used toimplement the present invention. However, the superstructure-basedapplication programming model of the invention could also be implementedusing other approaches.

It should also be noted that in the interest of simplicity and syntacticease of programming, the SimpleOS implementation of the inventiondescribed herein does not use XML as the grammar in all instances of itsprogramming. Again, one seeking to implement the invention could do soin various equivalent ways.

The following sections describe a SimpleOS implementation of theinvention, utilizing a series of conventions, names, structures andparameters specific to particular examples of a superstructure-basedapplication environment (SBAE) in accordance with the invention. Thoseskilled in the art will appreciate, however, that these conventions area matter of design choice, and were selected to make the illustratedimplementation simpler and more robust. Again, many variations arepossible and within the scope of the present invention.

Top-Level Branches

Conceptually, data within the superstructure is divided into three“branches” as shown in FIG. 9: Stylesheets 910, Classes 908 and Objects904, 906. Most of the application's data is stored in objects, which canbe created from classes. In the illustrated embodiments, stylesheetsgovern the visual presentation of the SimpleOS user interface. Thefollowing sections refer to the 3 major objects types shown in FIG. 9.

Objects and Classes

Directly under the root of the superstructure are a number of objectinstances. Each object instance has a unique name called an instancename. No two objects in the process's superstructure may possess thesame instance name. In the examples shown, each object containsstructured data that may include the following types of data defined bythe SQML DTD:

Methods: Code definitions that describe a dynamic modification to theobject

Data Members: The equivalent of variables, which can be of any of thesupported data types.

GUI Definitions: Definitions for cards, frame buttons, and othergraphical elements.

Additional types, defined in the future.

Within the programming language, new objects are created by processsimilar to a data structure clone. This operation either clones apre-existing object or creates an object based on a special templatecalled a class. A class definition can be identical to an object'sdefinition, except that it can only serve as a template. Any screens, orother data types stored within the class are unavailable unless they areused to create object instances. Each object is basically a copy of theclass; the class is purely a template. Every object has as parts of itsstructure the original class ID, so it remembers the class type. When anobject is cloned from another object, it doesn't remember what theobject ID of the original object however it retains the original classID no matter how many times the object is cloned.

In one practice of the invention, within SQML, both objects and classesare defined using the sq-class tag. A class is defined using syntax suchas: <sqml:sq-class classid=“class menu” extends=“class_menubase”><sqml:variable name=“index”>1<sqml:variable> </sqml:sq-class>. An objectinstance is defined using an identical syntax except that an objectIdattribute is included in the sq-class element. The following representsan object called main: <sqml:sq-class extends=“class_main”objectid=“main”> <sqml:variable name=“index”>123<sqml:variable></sqml:sq-class>.

The example above actually defines both a class called class_main and anobject called main. Both class_main and main could be used as the sourceof a new object instantiation. In the case of instantiating an objectfrom class_main, you would be creating a new instance of an object ofthe class class_main. Instantiating the object using main as a templatewould cause main to be cloned.

Stylesheets

Besides classes and objects, there is a third type branch of data withinthe superstructure called a stylesheets. A stylesheet defines a set ofvisual formatting characteristics that are used by the user interfacepresentation code. Stylesheets are discussed in great detail below.Table 1, below, shows an example of a stylesheet.

The implementation of stylesheets, per se, is well known in the art.However, their use in a superstructure-based application environment isan advantageous and novel aspect of the present invention, representinga useful and efficient way of making a platform-independent architecturehave a meaningful and expressive appearance within each specificimplementing architecture.

TABLE 1 A Stylesheet Example <sqml:stylesheet> <sqml:class id=“base”> <sqml:palette> <sqml:colordef name=“white” rgb=“#ffff00”/><sqml:colordef name=“black” rgb=“#ffff00”/> <sqml:colordef name=“red”rgb=“#cc0000”/> <sqml:colordef name=“blue” rgb=“#4444ff”/><sqml:colordef name=“yellow” rgb=“#ffff00”/> </sqml:palette> </sqml:class>  <sqml:class super=“base” default=“true”> <sqml:bgcolorcolor=“white”/> <sqml:font typeface=“Helvetica” typesize=“12”typecolor=“black”/> </sqml:class>  <sqml:class super=“base” id=“border”><sqml:bgcolor color=“blue”/> <sqml:font typeface=“Helvetica”typesize=“16” typecolor=“white” typestyle=“bold” /> </sqml:class></sqml:stylesheet>Object Overview

Objects group structured data, variables, and methods together in asingle named entity. As the highest-level branches within thesuperstructure, they maintain the basic organization of a runningprogram. There are three types entities generally found within objects:

1. Object Data Trees, containing arbitrary XML structured data

2. Object Data Members, data types available within the SQScriptprogramming language

3. Object Methods, SQScript functions that can be invoked on the object.

FIG. 10 summarizes the proceeding sections on each of these three types,showing object data trees 1014, object data members 1016 and methods1018.

Data Trees

One of the primary functions of an object is to provide a way ofgrouping SQML elements together into a “miniature DOM” so that it can bereferenced and accessed during the operation of a SimpleOS program. Inthe illustrated embodiments this data is typically used to describegraphical user interface elements, although the data may be any validtype of data expressible with SQML. The object's XML data payload iscalled the object's data tree.

Table 2 demonstrates an object that contains an XML data type defined inSQML called a sq-card. The sq-card definition is embedded inside the XMLthat described the object. Inside the superstructure, this sq-carddefinition will be attached underneath the object “main”.

TABLE 2 A Simple Object with a Data Tree <sqml:sq-classclassId=“class_main” objectId=“main”> <!-- The main card --><sqml:sq-card id=“card_main”> <sqml:title label=“MONOIDS” /> <sqml:toplabel=“ABOUT US” class=“border” /> <sqml:left label=“INSTRUCTIONS”class=“border” /> <sqml:right label=“MENU” class=“border” /><sqml:bottom label=“MENU” class=“border” /> <sqml:leftButtonlabel=“MENU” /> <sqml:rightButton label=“EXIT” /> <sqml:frame><sqml:image src=“splash.gif”/> </sqml:frame> </sqml:sq-card> </sqml>Element Identifiers

Each element inside the data tree of an object may contain an idattribute. For instance, the sq-card definition in Table 2 has an idattribute set to card_main. The id tags of the elements in a singleobject must be completely unique within that object. For instance, whileit would be possible for an object called differentObject to alsocontain an element named card_main, the original main object may nothave additional elements with the id card_name.

Because of the uniqueness constraint over the elements within anobject's data tree, and the uniqueness constraint over the name of anobject, a special namespace exists if these names are combined. Thisnaming convention is called an element identifier. In one practice ofthe invention, any element inside the data tree of any object may beuniquely addressed by the element identifier syntax objectID#elementIdwhere objectID refers to the ID of an object and elementID refers to theID of an element within the object. As a special rule, the objectIDportion of the identifier may be omitted within the same object.

Table 3 demonstrates several different formats for referring to elementswithin a hypothetical superstructure.

TABLE 3 Examples of Identifiers main#card_main The element “card_main”within an object called main. myObject#theButton The element “theButton”within the object myObject. #nextScreen The element “nextScreen” withinthe current object. myObject# Illegal - no element ID is present.Dynamic Sections Revisited

Data tree information may be part of a dynamic section, particularly ifit describes GUI data. If that is the case, any changes to the modelrepresented by the structured data within an object will automaticallybe reflected outside the application. For example, referring to Table 3,assume that main#card_main is the currently active screen. If any partof this definition within the object is updated, such as the name of aframe side, the physical display on the device will also be updated.Similarly, if the user updates the contents of a data field on thescreen, that change will immediately cause the relevant attribute withinthe object to change.

Data Members

Data members form a special class of elements that may be found withinthe data tree of an object or class. A data member is part of theelement data within an object, but may be accessed in the SimpleOSprogramming language SQScript as a local variable. This feature iscovered in detail in “Programming SimpleOS Applications” below.

Table 4 demonstrates a set of data members defined on a class calledclass_menubase.

Data members may be freely mixed with other valid data types, althoughonly the list and scalar syntaxes may be referenced as variables. In onepractice of the invention, expressions found within variable definitionsare evaluated when the class is instantiated.

TABLE 4 Examples of Object Data Members <sqml:sq-classid=“class_menubase”> <sqml:list name=“list_pizzaNames”><sqml:list-element>thin crust pizza</sqml:list-element><sqml:list-element>thick crust pizza</sqml:list-element><sqml:list-element>deep dish pizza</sqml:list-element> </sqml:list><sqml:variable name=“foo”>One Two Three</sqml:variable> <sqml:variablename=“bar”>1232</sqml:scalar> </sqm:sq-class>Methods

An object may also contain methods, which are custom-written programmingfunctions written in SQScript. (See “Programming SimpleOS Applications”below.) A method definition uses the function element tag within anobject's data tree. Table 5 shows a simple example of the use of thissyntax. It will be understood that while superstructure applicationscould be implemented without the use of methods, members and the like,they represent highly useful features of a SimpleOS implementation ofthe invention.

TABLE 5 Defining Methods for an Object <function id=“next”> <sqml:evalexpr=“index=$index+1” /> <sqml:if test=“$index > $list_pizzaNames:size”><sqml:eval expr=“$index=1” />  </sqml:if> </function>Graphical User Interface Data Trees

One frequently used data type stored within the data tree of an objectis the definition of GUI elements that are rendered by the Simple QuickGo Graphical User Interface (SQUI). In typical implementations,definitions for GUI elements such as SQCards will be among the mostcommon type of data stored within an object's data tree. A complex datagrammar governs GUI definitions, with structures that parallel thevisual presentation of the display.

Visual Presentation

To help explain the user interface sections of the SimpleOSsuperstructure, the following section describes examples of a SimpleOSuser interface.

In one embodiment, the user interface is divided into a number of nestedelements such as screens, controls, and images. Each of these elementshas a style, which is a reference to a stylesheet class that defines thepresentation attributes of the element: color, font, and layout. Nospecifics about the presentation of an element are contained within theGUI description area of the superstructure. (See “Stylesheets” below.)

Because of the limited screen size available on most implementations,the graphical user interface is divided up into a series of screenscalled “SQCards.” Only one SQCard may be displayed at a time. Theoperating system allows the developer to create a number of differentscreens at once, and choose which one should be displayed. Typically thedeveloper will organize specific areas of application functionality byscreen. In some cases, one screen flows into another naturally byselecting a control or pressing a frame button. In other cases, a screencan indicate an unexpected situation such as an alert.

Each SQCard contains a number of attributes and elements. An SQCard musthave a unique element id within its class. An SQCard also contains atitle, either as an image or as a text screen. There are other styleoptions available, such as a background image, spacing parameters andscrollbars.

Each SQCard's display includes four labels at the top, left, right andbottom of the screen, forming a central square frame. These are theframe buttons. They correspond visually to the buttons on the device'sfour-way controller. Within the region bounded by these labels appearthe main content of the SQCard. The square frame formed by the fourframe buttons is called the action frame.

Consider FIG. 11, showing the visual presentation of a GUI 1102. Thelook is dominated by the action frame 1120. Immediately above the actionframe is a title area 1104, which can either be a graphics image or atext label 1108. This label tells the user the current name of thescreen. Above the title label is a status area 1106 that containsinformation about the device, such as the date and time, and theonline/offline status of the application. Below the action frame is asoft key area 1122 where labels that correspond to physical buttons onthe device are shown.

The area inside the action frame is considered the control region 1124.Additional controls and content are presented inside this area. Controlscan include checkboxes, text labels, radio buttons, images, icons, andother typical, known user interface components. If the items inside thecontrol region exceed the size available, scroll bars 1110 will becomevisible that show the relative area of the virtual control area that isvisible on the screen.

GUI Data Examples

By way of example, the following SQML (Table 6) defines a very basicSQCard called “card00.” This code can be inserted as part of an object'sdata tree, where the GUI engine can later find it if the screen becomesactive.

TABLE 6 Sample Definition of an SQCard <sq-card id=“card00”> <toplabel=“MOVE UP” id=“top” class=“blue-on-yellow”/> <left label=“MOVELEFT” id=“left”/> <right label=“MOVE RIGHT” id=“right”class=“blue-on-yellow”/> <bottom label=“MOVE DOWN” id=“bottom”/></sq-card>

The main control region inside the action frame is defined by a frametag. This element may include checkboxes, radio buttons, text areas,images and other common graphical widgets.

The following example (Table 7) shows the definition of a frame insidean SQCard. Each editable area of the screen contains a value attributethat is updated automatically when the user operates the interface andchanges information inside controls. These value attributes live withinthe superstructure itself, and can be accessed using the normal meansfor looking up data values.

TABLE 7 Sample Frame Definition <frame class=“plain” id=“frame00”><image id=“comp0” src=“icon1.gif”/> <checkbox id=“comp1” label=“this isa checkbox”/> <radiobutton id=“comp2” label=“this is a radiobutton”/><textarea class=“blue-on-yellow” id=“comp3”> Some text </textarea></frame>The “Active” Card

In one practice of the invention, at any given time, there is always oneactive sq-card definition, found within an instantiated object withinthe superstructure. This means that the most basic application possiblemust contain at least one object instance that has at least one sq-carddefinition within its data tree. A variable within the dynamic sectionof the superstructure, called ui#card tracks the instance name andelement id of the current sq-card. This value is kept as an elementidentifier string, and stored on an attribute found within theimplicitUI object. For more information about the implicit UI object,see “Implicit Objects” below.

As a convenience to the programmer, the initial value of the activescreen variable can be set using the “activate” attribute on the sqmltag. See the example shown in Table 8.

TABLE 8 Example: Defining the Initial Card <sqmlappid=“com.sqgo.simpleos.application.demo” activate=“main#card00”>Example Static Application

The following sample application demonstrates what a simple applicationmight look like when represented as SQML. (Again, many variations arepossible, and the invention does not mandate the structure shown by wayof example.) This application presents a simple screen to the user thatlooks like that shown in FIG. 12.

The source of the application depicted in FIG. 12 is shown in Table 9.Note that stylesheets are used in this example. Stylesheets arediscussed in detail below.

The basic structure of the application starts with an sqml tag, whichrepresents the root of the superstructure. Below it is defined oneobject called main, which contains a sq-card definition inside its datatree. The activate tag on the sqml tag causes this card to be initiallydisplayed to the user. See Table 9.

TABLE 9 Static SimpleOS Application Example in SQML <?xml version=″1.0″encoding=″UTF-8″?> <!DOCTYPE sqml SYSTEM ″sqml.dtd″> <!--  A simpleapplication without any dynamic handlers Demonstrating controls andcards. --> <sqml appid=″com.sqgo.simpleos.application.demo″activate=”main:card00”> <sq-style-sheet> <class id=″base″> <palette><colordef name=″blue″ rgb=″#4444ff″/> <colordef name=″yellow″rgb=″#ffff00″/> <colordef name=″white″ rgb=″#ffff00″/> <colordefname=″pink″ rgb=″#ff8888″/> </palette> </class> <class super=″base″default=″true″> <bgcolor color=″blue″/> <font typeface=″Courier″typesize=″14″ typecolor=″white″  typestyle=″bold″ /> </class> <classsuper=″base″ id=″blue-on-yellow″> <bgcolor color=″yeller″/> <fonttypesize=″10″ typecolor=″blue″ /> </class> <class super=″base″id=″plain″> <bgcolor color=″pink″/> </class> </sq-style-sheet> <sq-classclassid=″class_main″ objectid=″main″> <sq-card id=″card00″> <toplabel=″MOVE UP″ id=″top″ class=″blue-on-yellow″/> <left label=″MOVELEFT″ id=″left″/> <right label=″MOVE RIGHT″ id=″right″class=″blue-on-yellow″/> <bottom label=″MOVE DOWN″ id=″bottom″/> <frameclass=″plain″ id=″frame00″> <image id=″comp0″ src=″icon1.gif″/><checkbox id=″comp1″ label=″this is a checkbox″/> <radiobuttonid=″comp2″ label=″this is a radiobutton″/> <textareaclass=″blue-on-yellow″ id=″comp3″> Here is a text area that shouldspread onto multiple lines. We the people, in order to form a moreperfect union, establish justice, ensure domestic tranquility, providefor the common defense, promote the general welfare and secure theblessings of liberty for ourselves and our posterity do ordain andestablish this Constitution of the United States of America. </textarea></frame> </sq-card> </sq-class> </sqml>Implicit Objects

One of the key design principals of SimpleOS is that the applicationsuperstructure represents the entire state of the running program at alltimes. In order to ensure this is always the case, SimpleOS (or similarsystem in accordance with the invention) may define a number of implicitobjects. (Note that while it is possible to configure asuperstructure-based application environment without implicit objects,they are of great utility in configuring a useful result.) These objectsrepresent the state of the operating system and are essentially inherent“dynamic sections.” For example, the ui object that described aboverepresents the state of the visual display, which belongs to theoperating system rather than to the application. These implicit objectsmay or may not be accessible to the application via SQScript.

An implicit object behaves as a regular object within thesuperstructure. It contains data attributes, methods, and a structuredata tree. However, these objects are always found in thesuperstructure, whether or not the seed SQML image for the applicationdefines them. They are created and populated when the SimpleOS loaderfirst creates the superstructure for a new process.

If the SQML source code of an application does define an implicitobject, the values found within the definition will be used to populatethe contents of the implicit object. It is impossible to remove animplicit object from memory at any time

Implicit objects are almost always part of the dynamic section of thesuperstructure, since they typically reflect meaning that varies fromprocess to process and changes over time. Implicit object can be used bySimpleOS to represent the state of the user interface, otherapplications in memory, the queue of currently playing sounds andexternal interfaces such as BLUETOOTH and 802.11b.

IV: Programming SimpleOS Applications

In accordance with the principles of the present invention, the SimpleOSembodiments described herein (and similar configurations in accordancewith the invention) allow for an implementation in which basic types ofapplications can be written entirely through the use of a drag-and-dropeditor, thus greatly simplifying the creation of applications. Morecomplex applications may be written using both server-based andclient-based code. The following section describes examples of variousways to program SimpleOS applications (SimpleOS being but one example ofthe invention), including network and client-local programming.

Overview

Changes inside of a SimpleOS application are simply updates to atree—usually, the data tree within a SimpleOS object. This tree updatemay include changes to a basic attribute on an existing node or mayinvolve widespread changes to the entire organization of the object inquestion. Programs to modify the current tree may be written using avariety of methods. They may include (but are not limited to):client-native, built into SimpleOS, written using SQScript, a platformindependent programming language, or written using any commonserver-side programming language. It is a significant feature of theinvention that while the various programming models are very different,the superstructure modifications performed by the programs are the same.This focus on tree manipulation calls for a programming model that isoptimized for tree transformations.

The superstructure-based model of programming shifts almost all of theusual work a program does to maintain its user interface and otherexternal interfaces into modifications of a tree. SimpleOS applicationsdo not need to concern themselves with maintaining communication with anApplication Programmer Interface or with the nuances of userinteraction. All of the general environmental and user-interactionfunctionality is handled for the application by SimpleOS. Whenapplication code is run, all of the state of the application has alreadybeen updated inside the superstructure. The code merely has to changedata within the superstructure, and the complex work of making thosechanges apparent within the host operating system occurs automatically.

There is very little difference between programming on a network serveror directly on the device. Data within the superstructure can beefficiently communicated over a network, and a set of tree-updates caneasily be communicated back to the device. Consequently, there is almostno friction for a network program that wishes to perform equivalentoperations to client-local code.

Core Programming Modes

It is expected that many implementations of the invention will naturallygravitate toward having much of the application logic expressed as somelocal programming embedded therein. However, other mechanisms, includingthose described above, can also be supported. SimpleOS, among examplesof the invention set forth herein, supports at least four basicmechanisms that illustrate how client-native, superstructure-local,network, or built-in approaches are enabled.

In a SimpleOS practice of the invention, a highly useful model forcoding is a special programming language called SQScript. SQScript isoptimized for tree transformations and can run on any implementation ofSimpleOS. There are also several alternative methods besides SQScript.The application can use native-language code to manipulate thesuperstructure through the use of a special API. In this case, any codethat can be dynamically or statically linked into the SimpleOS containercan be used to manipulate the superstructure. Of course, using nativecode eliminates many of the advantages of portability and securitygained by SQScript. Another alternative is to use a set of “defaulthandlers” that provide common pieces of application functionality out ofthe box. Finally, code can reside on the network, allowing a server toprovide all of the application logic.

Each of the four approaches to SimpleOS programming revolve around thesuperstructure in one way or another, and focus on tree-updates as theprimary means of accomplishing work within the applications. These modesmay easily be combined within a single application. Table 10 summarizesthe various programming mechanisms, and their uses. These programmingmodes are next discussed.

TABLE 10 The Four Core Programming Modes Mode Description Benefits/UsesSQScript An XML-based programming Completely client-local, language thatoffers the this approach allows a ability to write structured SimpleOSapplication to programs that modify the be completely superstructuredirectly. self-contained. SQScript programs may either make smallattribute modifications to the superstructure, or may completelytransform existing objects into new objects using arbitrary rules.Network In this mode, parts of the Allows for a program or Serversuperstructure are part of a program to be converted into XML and sentcontrolled from a to a remote device where a remote-server whereserver-side programming additional data and language receives the data.other software resources Updates to objects are can be found. describedon the network server and sent back to the device where they update thesuperstructure. Client- When supported, allows Allows existing Nativenative code residing on the programming logic to device to receivemessages control a SimpleOS from the application and application,possibly perform updates directly to with increased speed or theapplication's access to client superstructure using a resources. Thismode native-language API. may be extended to the point that SimpleOSbecomes an exclusive a shell for the application's user interface.Default Built-in event handlers May be used to perform Handlers thatcome with SimpleOS and simple actions without perform common operationsthe need for any without any additional custom programming.programming..SQScript

SQScript, a further aspect of the present invention, is a simple andpowerful client-local programming language useful in implementingvarious inventive features described herein. SQScript allows programmersto write methods on objects within the superstructure, or to createinterpolated expression blocks simply by enclosing code inside { }blocks. See the “SQScript” discussion below.

Default Handlers

One of the four programming modes available in SimpleOS is the defaulthandler. As a convenience to the SimpleOS developer, the environmentprovides a set of default handlers that can perform simple operationssuch as changing the current screen, updating a simple list ofattributes, pausing an application, etc. These default handlers areimplemented internally using native code and affect the application'ssuperstructure through an API within the code of the SimpleOSimplementation itself.

The context argument passed to the default handler will have varyingmeanings depending on the nature and specification of the handler.Arguments to default handlers may be provided in the message descriptor.

Client-Native Code Handler

Some implementations of SimpleOS will support message handlers writtenin native code. These handlers comprise one of the four programmingmodes available from within SimpleOS. In this case, information insideof the message descriptor will indicate runtime dispatch information.The client-local runtime handler will have access to the superstructurefrom an API provided by SimpleOS.

The client-native API basically allows code to register for callbackswhen particular events occur. Once control has been given to a clientfunction, it can read and write values out of the superstructure,instantiate objects and modify data trees by using a set of API calls.The changes that the client-handler makes are verified the same way asany other change made by an application handler. See “Execution Cycle”below. Changes must conform to the basic superstructure rules, and thereis no way to perform any operation within the superstructure that wouldnot also be allowed by SQScript.

In the most extreme case of using client-native code, SimpleOS becomes auser-interface shell around purely native application logic. In thissense, SimpleOS can be seen as a user interface library. A3.sup.rd-party developer can link this user interface library into anexecutable program to give it the capabilities of SQUI. This productoffers a large advantage for developers because it will save them theeffort of writing custom GUI code for their own applications.

Remote Execution Model

The target of a message may be remote resource available over theInternet or on a wireless local area network such as a BLUETOOTH-enabledvending machine or kiosk. In this case, the message object is formattedand serialized into SQML (an XML grammar) that is sent to the targetusing the necessary protocol. In this case, a separate communicationmechanism is used for the remote system to update the superstructure onthe device. See “Network Communication” below.

Execution Cycle

SimpleOS (or any superstructure-based application environment inaccordance with the invention) uses a message-driven model to deliverevents and other information to the application. Each running SimpleOSprocess maintains a message queue with events from the outside worldsuch as user activity, interface manipulations, network messages, andexternal interfaces. Through data in the superstructure, the applicationdescribes which events it is interested in receiving. When the queue hasone or more relevant messages, SimpleOS will dequeue each messageone-by-one and deliver it to the application's requested handler. At anytime, zero or more events may be waiting for a particular application,and they are processed one by one. This message queue can be a first-infirst-out queue, with a mechanism to defer the delivery of messages ifthe application is unavailable or if network connectivity is necessary.

When an application's handler is invoked, it can receive informationabout the current state of the user interface and other externalinterfaces by reading data within its superstructure. The handler maythen make modifications to the superstructure based on this data. Whenthe handler exits, the operating system examines the changes to thesuperstructure and performs the relevant activities within the externalsystems that pertain to the modified sections of the superstructure. Themodel causes all changes to be atomic with respect to thesuperstructure, where each change is the result of a completedevaluation pass of the application code. The application never retainsexecution flow with its own event loop or polling system under anycircumstances.

The execution cycle is comprised of the sequence shown in Table 11. Eachof the five phases shown is next discussed.

TABLE 11 Phases of the Execution Cycle 1. External Event Occurs: Someevent outside the application occurs, such as user activity or a networkevent. This is commonly the result of interaction with the userinterface, such as a button press. 2. Primary Update to Superstructure:The operating system updates the superstructure if necessary with datafrom the event. For example, the new value of a text field might bewritten into the value attribute of a text field element. 3. InvokingApplication Handlers: A registered application handler is selected andrun. This handler may be any of the four types. 4. Modifications to theSuperstructure: The handler modifies the superstructure in some way andexits. For instance, the application could change the value of a textlabel. 5. Verification and Update: SimpleOS verifies that the new stateof the superstructure is correct and performs the modification. Forinstance, the application might see that a text label has changed in thesuperstructure and draw the change on the screen. SimpleOS re-rendersthe interface if necessary, potentially running interpolated code withinthe GUI definitions.External Events

A process may receive virtually any type of external event. Theseexternal events are typically user interface events such as buttonpresses or field updates. However, they may also be network events,messages from other application processes or telephony activity.Bluetooth or 802.11b messages may also be processed inside anapplication.

In one practice of the invention, the context for an event is keptwithin an Event Object, which is instantiated into the superstructurewith a temporary name and passed as an argument to the handler. Withinthe event object, there is data that may include the time and date ofthe event, details about how the event occurred and other event-specificdata.

Primary Update to Superstructure

Before an application handler is executed, SimpleOS must synchronizeexternal state with data inside the superstructure. Depending upon theselected implementation, this may either occur all at once, just beforethe delivery of a message, or it can occur incrementally as the changestake place. Regardless, the application's code is not executed unlessall of the data inside the superstructure accurately reflects the stateof the application.

Dynamic text fields present a perfect example of why this phase isimportant. When a user updates a text field, the application is nottypically interested in knowing about each and every key press. Instead,the operating system will update the screen with each key press.However, when the user presses a “continue” button, the applicationprobably will register an event handler so that it may verify the datawithin the text field and perform some other action. In this case,before the application's code is run, SimpleOS must make sure that thesuperstructure has been updated with the value of the text field. Itdoesn't matter if this occurs as the field is changing, or just beforethe application's code is run.

Invoking Application Handlers

In one practice of the invention, the application can register an eventhandler using any of the four programming modes. A synopsis of theavailable modes is shown in Table 12.

TABLE 12 Synopsis of Event Handler Modes Handler Mode DescriptionDefault A “canned” handler pre-defined in the system that Handlerperforms a basic task such as changing the current screen. SQScript Alocal function stored in the superstructure. This handler is passed thename event object as an argument. See text for more information.Client-Native A client-local handler written in some native Code Handlerlanguage on the device. The code is passed the name of the event object.Network The event object is sent to a remote network Server location inthe form of SQML. See text.Modifications to the Superstructure

When the handler runs, it may update sections of the superstructureusing either a template expansion or a set of node updates. SimpleOStracks these changes as they occur, so that the new state of thesuperstructure can be efficiently synchronized with the host operatingsystem when the modifications are complete.

Verification and Update

Once the handler has completed, SimpleOS may verify the superstructureto ensure that it still contains valid information. This verificationmay include security checks, validation of data formats and objectreferences, and other steps that help make the application environmentmore secure.

Once SimpleOS is satisfied with the changes, it must perform the workthat is described in the new version of the superstructure. Forinstance, if the application has modified the labels of text fields,these text fields must be re-drawn. Often, this will involve copyingdata out of the superstructure and into the native programming librariesthat SimpleOS uses within the host environment. This can also serve asstage where data can be verified for validity, security, andconsistency.

The change list compiled during the previous phase may be used at thispoint to optimally make modifications. Since SimpleOS knows the sectionsof the superstructure that were changed, it can avoid performingactivities within the host environment that are not required.

SimpleOS allows the application to insert dynamic SQScript expressionswithin the values of some SQML attributes and literal fields. Anyattribute or literal field that contains one or more SQScriptexpressions may change in value over the course of the program'sexecution. Whenever SimpleOS renders the current SQCard, it re-evaluatesall SQScript expressions found in its attributes and literals anddisplays the new results. It is by means of these SQScript expressionsthat the programmer is able to cause computed data to be displayed. Forinstance, let's say the application is presenting a set of check boxesto the user and wishes to display the number of checked boxes. Theapplication could define a label for a text field that includes aSQScript expression block that computes the number of checked boxes.Whenever a change to the state of the application occurs, SimpleOSevaluates this expression block and displays the newly computed numberof checked boxes. The programmer may also use this feature to alter theappearance of the SQCard by inserting SQScript expressions into the SQMLattributes that control style. Because this feature corresponds soclosely to the attribute value templates defined by the XSLTspecification, we use the same term to describe these inserted SQScriptexpressions in SQML.

Programming Contexts

In one practice of the invention, SimpleOS is configured to allowin-line code in SQScript to be executed in different places. This is nota requisite of the invention, but is useful in implementing theinvention. Generally speaking, there are three occasions when whereprogramming code can be executed:

-   -   Handlers: A SimpleOS application may register handlers for        particular events on various objects. When the event occurs, the        code is activated.    -   Attribute Value Templates: Attribute value templates may appear        within some attribute values and literal text fields. They        appear as SQScript expressions bounded by curly braces { }.    -   Initializer: When SimpleOS instantiates a new object, it will        run an initializer method on the object. Each of these three        code contexts applies selectively to the various programming        modes available in SimpleOS.        Table 13 describes which modes are available in which context.        In cases where a mode is not available, an additional        explanation is provided below.

TABLE 13 Availability of Modes within Code Contexts Event AttributeValue Mode Initializers Handlers Templates SQScript Yes. Yes. Yes.Network-Resident No. (Note 1) Yes. No, not even via SQScript. (Note 2)Client-Native No. (Note 1) Yes. No, not even via SQScript. (Note 2)Default Handlers No. (Note 1) Yes. No, not even via SQScript. (Note 2)Registering for Events

Those skilled in the art will appreciate that a superstructure-basedapplication environment must provide some means within its structuraldefinition for an application to register handlers for events, so thatwhen external events occur to the application and are updated by theoperating system into the application's superstructure, the applicationhas the opportunity to run an appropriate update, trigger some dynamiccode, or take other action. In practice, these registrations could occurexplicitly (as a set of nodes that specify “when X occurs, run code Y”),or implicitly (through evaluation where the operating system attempts toevaluate some expression in the superstructure after an event hasoccurred and incidentally must force the evaluation of some code or thetriggering of a network event). In either case, the registration couldrefer to local superstructure code, client native code, code within thesoftware container itself, or network events or communications.

Thus, in an example of a SimpleOS environment, event handlers must beregistered inside the superstructure so that SimpleOS knows that anapplication is interested in a notification when an event occurs. Eachregistration must identify the criteria of the event and provide atarget where the event will be delivered. The following discussiondescribes two basic approaches for registering handler events insideSimpleOS.

In-Line Event Registration

The in-line style of event registration is the simplest and mostconvenient method for registering for an event. In this style, elementswithin the data tree of an object contain an attribute named for acommon event type, such as on Activate or on Change. When thecorresponding event occurs, the value of the attribute is examined andexecuted.

In its simplest form, the in-line value may simply be a small SQScriptexpression block. In this case, the expression block will cause thecurrent card to change to card_main. See, for example, Table 14.

TABLE 14 In-Line Event Registration with Code <sqml:sq-cardid=″card_menu″> . . . <sqml:right label=″CHECK OUT″ class=″border″onActivate=″{ui:card=’card_main’}}″ /> . . . </sqml-sq-card>

The in-line registration value may also be a local method. In theexample of Tables 15 and 16, pressing the “Check Out” button will invokethe method called next on the current object. The following exampledemonstrates this format.

TABLE 15 In-Line Event Registration for a Method <sqml:sq-cardid=“card_menu”> . . . <sqml:right label=“CHECK OUT” class=“border”onActivate=“next”/> . . . </sqml-sq-card> <function id=“next”><sqml:eval expr=“index=$index+1” /> <sqml:if test=“$index >$list_pizzaNames:size”> <sqml:eval expr=“$index=1” /> </sqml:if></function>

TABLE 16 In-Line Event Registration to a Server <sqml:sq-cardid=“card_menu”> . . . <sqml:right label=“CHECK OUT” class=“border”onActivate=“http://myserver.com/handleCheckout” /> . . . </sqml-sq-card>

The in-line registration may be a URL to a remote site. In this case,the current object is serialized and sent as a POST to the server shown.The server may respond to the POST with an update to the current object.The network communication model is described in detail below in the“Network Communication” section.

Finally, the in-line registration may refer to a message descriptor, asdescribed in the section below.

Message Descriptors

Message descriptors allow for a more robust model for registeringevents. This mechanism is necessary since the in-line style of eventregistration does not provide a way to specify additional parameters forthe receipt and dispatch of an event.

A message descriptor is an XML data type stored within the data tree ofthe appevent implicit object. SimpleOS will examine descriptors withinthe appevent object if no in-line message registrations apply. Eachmessage descriptor defines the type of event, the element identifier forthe entity that generates the event, and the location within the codesection of the superstructure where the handler can be found. Forinstance, if the application wants to be notified when a button ispressed, it would define a message handler of type “on Activate” for asource id of the button “myObject#myButton.” The descriptor also mustspecify a code target, such as“anotherObject#root.code.myButtonHandler.” This target pathnamespecifies the element identifier where the handler for the button can befound.

In addition to a type, source and target, the message descriptor mayalso contain a set of context elements that describe the ids of objectsto be sent in the message. For instance, suppose the button“mainScreen#myButton” acts as a submit button to calculate data filledin on a form with fields “mainScreen#firstName” and“mainScreen#lastName”. It would be helpful in the handler for myButtonif the values of the buttons on mainScreen were easy to access. In thiscase, the context for myButton's handler could be set to the object“mainScreen”, which would result in a copy of the mainScreen object andall of its data tree children to be easily accessible from withinroot.code.myButtonHandler. In cases where the message is delivered overthe network, this syntax is imperative.

The chart shown in Table 17 summarizes the parts of a messagedescriptor.

TABLE 17 Fields in a Message Descriptor Attribute Description Example idA unique id for the message sampleEvent identifier that is used toidentify the message to the handler. Type The type of event that willonActivate trigger this message Source The source element for themyScreen#myButton event. Target The message handler thatMyScreen#myButtonHandler will receive this message. In this case, alocal method. Context An object to include in the OtherScreen eventdescriptor.While the exact syntax for message descriptors may be left to theimplementer, the hypothetical message descriptor definition shown inTable 18 may be employed. Thus, in Table 18, the descriptor will causethe handler myScreen#handler to be run when myScreen#myButton isactivated. If the target were a network entity, the object otherScreenwould be send along with the event object.

TABLE 18 Example: A Basic Message Descriptor <sqml:message-descriptorid=“sampleEvent” type=“onActivate” source=“myScreen#myButton”target=“myScreen#handler> <sqml:context objectId=“otherScreen”/></sqml:message-descriptor>

Message descriptors are commonly used to invoke native functions as wellas default handlers.

Combination with In-Line Syntax Message descriptors may be triggeredfrom within the in-line syntax, or even by posting an event from withinSQScript code. This is ideal for situations where a message must be sentover the network using the rich message descriptor functionality, butthe programmer wishes to use the simplicity of the in-line syntax. Forexample, consider Table 19.

TABLE 19 Example: Combining In-line Registrations with MessageDescriptors <sqml:sq-class classId=″class_main″ objectId=″main″> <!--The main card --> <sqml:sq-card id=″card_main″> <sqml:titlelabel=″MONOIDS″ /> <sqml:top label=″ABOUT US″ class=″border″onActivate=”#desc” /> <sqml:frame> <sqml:image src=″splash.gif″/></sqml:frame> </sqml:sq-card> <sqml:message-descriptor id=”desc”target=”http://server.com/foo” > <sqml:context objectId=”otherScreen”/></sqml:message-descriptor> </sqml>

Here, when the on Activate event occurs on the top button, the messagedescriptor desc, stored on the current object, will be activated. Thismessage descriptor will send a message object to http://server.com/foothat will include the value of the otherScreen object. Note that in thiscase the source and type attributes on the message-descriptor tag arenot needed, since this context is provided by the in-line eventregistration.

Event Objects

When an event is delivered, an event object is temporarily created andpassed as an argument to the message handler. The event object containsthe context of the event, which may include the time that the eventoccurred, the sending object, the location of the cursor, and otherinformation.

V: SQScript Language

The SQScript language, described by way of the following examples,discussion and reference materials, is a highly useful means toimplement client-side code on SimpleOS. Unlike native code, SQScript canrun on any of the SimpleOS supported platforms. It provides strongersecurity than native-code handlers and is much easier to write. Thefollowing sections describe the SQScript language in detail.

It should be noted that the SQScript language demonstrated below is butone of many possible languages suitable for manipulating asuperstructure-based application in accordance with the invention. Asuperstructure-driven operating system and application environment couldomit some features of the language described below, or add otherfeatures, and still be within the ambit of the invention. Otherlanguages with different syntaxes could be used; or in certain cases, animplementer could avoid using any language locally at all, and insteadrely on all updates to occur over a network. For purposes of theSimpleOS examples set forth herein, the applicants have opted to use alocal language.

It should also be noted that the programming language demonstrated belowwas designed to be syntactically similar to XSLT, a programming languageused to transform tree structures. However, the execution environmentwhereby the application interacts with the operating system is (as willbe seen below) radically different from XSLT, because the treetransformations themselves form the basis of continuous processes ofmaintaining the application, as opposed to a one-time translation.

Hello World Example

In connection with an introduction to SQScript, consider the followingHello World example, depicted graphically in FIG. 13. In this example, ascreen 1300 is presented to the user with a single button (such as abutton of the conventional 4-way controller 1306, which includes arrowkeys 1308, center key 1310 and additional keys below, 1312). When thebutton is pressed, the message “Hello World” is displayed. Note that asimple Hello World can actually be accomplished simply by defining ascreen with the text “Hello World.” However, this example involves somecode, so it provides an introduction to SQScript programming. Inparticular, possible source code for this application is shown in Table20.

TABLE 20 Example: Hello World <sqmlxmlns:sqml=“http:/www.sqgo.com/sqml/sqml.dtd”appid=“com.sqgo.simpleos.demo.helloWorld” activate=“main:card _(—)main” > <sqml:sq-class classid=“class_main” objectid=“main”> <!-- Themain card --> <sqml:sq-card id=“card_main”> <sqml:title label=“HelloWorld” /> <sqml:right label=“START” class=“border”onActivate=“{ui:card=‘main:card _(—) hello’}” /> <sqml:frame><sqml:textarea>Welcome To the Hello World Application </sqml:textarea><sqml:textarea>Press “start” to continue </sqml:textarea> </sqml:frame></sqml:sq-card> <!-- The “hello world” card --> <sqml:sq-cardid=“card_hello”> <sqml:title label=“HelloWorld” /> <sqml:frame><sqml:textarea>Hello World </sqml:textarea> </sqml:frame></sqml:sq-card> </sqml:sq-class> </sqml>

Note that the stylesheets for this and other application code exampleshave been omitted to improve the clarity of the examples. Bold sectionsof the code example are discussed below.

Within the initial sqml tag, notice the presence of the attributedefinition activate=“main:card_main.” This tells SimpleOS that theinitial card to show on the screen should be the entity named“main:card_main.” In fact, SimpleOS will set the ui.card value to thisstring when the application loads. This statement presumes thatsomewhere within the process's superstructure, there is (or will be) anobject called main with a sq-card definition called card_main.

Sure enough, in the sq-class definition, there is an attribute calledobjectid. This attribute indicates to SimpleOS that after the classclass_main has been defined, an instance of the class will automaticallybe created and called main. This solves the problem earlier of havingset the current card to main:card_hello.

Within the right tag, we define our one and only button. The purpose ofthis button is to change the current screen from card_main tocard_hello. In order to do this, we have to register to receive the onActivate message on the right card button. We also must define some codeso that the target of the handler will actually cause the screen tochange. As previously discussed, screen changing is accomplished bychanging the value of ui:card to an element identifier that points tothe desired object and card within the object.

The attribute on Activate=“{ui:card=‘main:card_hello’}” performs boththe registration and code definition action. (This is an example of anin-line event registration.) First of all, the expressionui:card=‘main:card_hello’ is surrounded by curly braces (the ones thatlook like this: { }). These curly braces tell the SQScript interpreterthat when the on Activate expression is read, it should invoke theexpression language parser to run the expression inside the braces. Theexpression plus its surrounding curly braces is called an expressionblock.

Finally, within the text area tag found in the second card definition,we find our “Hello World” text.

The SQML Tag

The <sqml> element type is the root of all SQML documents. The <sqml>element can contain an optional <sqml:style-sheet> element, followed byzero or more <sqml:sq-class> elements. The <sqml:style-sheet> element isonly allowed when the doctype attribute on the <sqml> element is set toapplication or fragment.

The formal XML declaration for the <sqml> element is as follows:<!ELEMENT sqml ((style-sheet?), (sq-class*))>. See Table 21.

TABLE 21 The SQML Tag Attributes Attribute Purpose xmlns Required -defines the SQML namespace. It should be formatted as follows:xmlns:sqml=″http:/www.sqgo.com/sqml/sqml.dtd″ appid Required -application ID. By convention uses a Java-like naming style. Example:appid=”com.sqgo.simpleos.application.sample1” sessionid Required forapplications with network interaction. Indicates the session to whichthis document applies. doctype Required, possible values include:application: this is a full SQML application document fragment: this isa fragment (update) to an SQML application message: this is a networkmessage object: this is serialized object activate Names an object IDand sq-card to be activated by the application. Note that this is anobject ID and not a class ID; therefore, the class should use theauto-instantiation feature and specify the same object ID. Example:<sqml xmlns:sqml=″http:/www.sqgo.com/sqml/sqml.dtd″ appid=″com.sqgo.simpleos.application.sample1″  doctype=”application” activate=”main#card”>  <sqml:sq-class classid=”main”> <sqml:sq-cardid=”card”>  ... sq-card elements ... </sqml:sq-card>  </sqml:sq-class></sqml>Expression Blocks

The most basic execution unit within SQScript is an expression block.Expression blocks can be found almost everywhere inside a class orobject. They indicate code in the SimpleOS Expression Language thatshould be evaluated. The SimpleOS Expression Language (EXL) is actuallynot based in XML like most of SimpleOS. The expression language is astring-based language with a special grammar vaguely reminiscent ofXPATH, the expression language of XSLT. Expressions can involveassignment, variable lookups, data tree lookups, conditionalexpressions, mathematical calculations, predicate logic, and a varietyof other typical programming constructs. A substitution expression canbe used to define the name or value of almost any attribute within thetemplate as well as the predicate of any conditional or loopingstructure. The exact details of the grammar will be considered veryshortly.

Expression blocks can be placed almost anywhere that the interpreterexpects a string. When a string is needed (such as the value of the onActivate tag in the example above), the expression is immediatelyevaluated in its current context. When expressions are placed in an onActivate block, they are evaluated when the object in question receivesan activate event. Expressions can also be found inside other placeswithin the data tree, such as in the name of a label or the value of atext area. In this case, whenever SimpleOS needs to find the actualvalue of the string, it first will evaluate the expression andsubstitute the value of the expression into the place where it wasfound. In this case, the expression block is called a substitutionexpression. This behavior is also known as expression interpolation.

Consider the examples shown in Tables 22, 23 and FIG. 14. Each willresult in a string “The magic number is 42.” In these examples, theexpression is evaluated every time the screen is redrawn.

TABLE 22 Example: Expression Interpolation in Text Elements<sqml:sq-card id=“card_hello”> <sqml:title label=“Magic Numbers” /><sqml:frame> <sqml:textarea>The magic number is {2+40}. </sqml:textarea></sqml:frame> </sqml:sq-card>

TABLE 23 Example: Expression Interpolation in Attributes <sqml:sq-cardid=″card_hello″> <sqml:title label=″Magic Numbers″ /> <sqml:frame><sqml:label text=”The magic number is {2+40}.” /> </sqml:frame></sqml:sq-card>See FIG. 14 for visual presentation (screenshot) of the result.

Some attributes are not allowed to contain expression interpolationblocks. These include the “id” and “name” attributes, as well as withinthe structural tags such as sq-class.

Escaping Interpolation Characters

In order to use the {and} characters within a string without marking anexpression block, you must escape them using the backslash character.

Interpolation and Assignment

If the interpolated expression is an assignment, the substituted valuewill be null. For instance, consider the following string: “This isa{foo=$bar} test.” When evaluated, this expression will become: This isa test.

Data Types

Although all data in a SimpleOS application originates from SQML, whichis entirely character data, the SQScript evaluator recognizes andhandles data types other than character. SQScript supports the followingdata types: String: a string of characters; List: a linear list ofcharacter strings; Boolean: true or false; Numeric: an integer orfloating point value; Element Identifier: a reference to an object or anamed element in an object, such as a SqCard or variable. Any quotedstring in a SQScript expression is treated as a literal String value.Single or double quotes may be used. An unquoted string in a SQScriptexpression is an element identifier. When a literal Boolean value iscalled for, the built-in functions true( ) and false( ) provide values.(The quoted string ‘true’ is a String value, and an unquoted string isan element identifier.)

In this case, the string is parsed as an element or object identifier.If the element doesn't exist and the reference is followed, a runtimeerror will occur.

The SQScript evaluator expects the expression found in the testattribute of an if or for element to evaluate as Boolean. The evaluatornever coerces a Boolean value from a non-Boolean. A Boolean may beformatted as a String, the result of which will always be “true” or“false.”

Arithmetic operators expect numeric operands, and produce numericresults. When evaluating arithmetic operators, the expression evaluatorcoerces string operands into numeric values by scanning the strings. Ifany operand string does not represent a number, the special value NaN(not a number) is the result of the operation.

Introduction to Variables

Variables within SQScript can be used to temporarily store data betweenevaluations of single expressions. The most basic type of variable iscalled a scalar. A scalar can represent any single string, number,Boolean or object/element identifier. Variables have a name that is usedto find the value or to assign a new value.

Variables are declared by including a variable declaration somewherewithin the scope of an object. “Somewhere” is very broad. If thevariable declaration occurs directly underneath a class or object, it isconsidered a “member variable.” However, a variable can also be declaredanywhere within a function (we'll get to that later), in which case thevariable is considered to have a scope bounded by the nesting of theprogram block. These rules are very similar to variable scoping rules inC or JAVA.

Table 24 shows an object with a single variable.

TABLE 24 Example: An Object with a Single Variable <sqml:sq-classclassId=“myClass” extends=“theObject”> <sqml:variablename=“index”>1</sqml:variable> </sqml:sq-class>

In this example the variable is called index. Code inside myClass canreference this variable using a variable syntax like $index. Theexamples shown in Tables 25 and 26 demonstrate the use of this syntax.(As defined herein, scalars can contain both numbers and strings.) Theresult of these two cards, when displayed, is shown in FIG. 15 (see1502, 1504).

TABLE 25 Example: Object with a String Variable <sqml:sq-classclassId=″myclass″ extends=″theObject″> <sqml:variablename=″myString″>Hello World</sqml:variable> <sqml:sq-cardid=″card_hello″> <sqml:title label=″Example A″ /> <sqml:frame><sqml:textarea> The Value of myFirstString is “{$myString}”.</sqml:textarea> </sqml:frame> </sqml:sq-card> </sqml:sq-class>

TABLE 26 Example: Object with a Numeric Variable <sqml:sq-classclassId=″myClass″ extends=″theObject″> <sqml:variablename=″myNumber″>3.1415926</sqml:variable> <sqml:sq-card id=″card_hello″><sqml:title label=″Example B″ /> <sqml:frame> <sqml:textarea> The Valueof myFirstString is “{$myNumber}”. </sqml:textarea> </sqml:frame></sqml:sq-card> </sqml:sq-class>Variable Assignment

The := operator can be used to assign new values to variables. Considerthe examples of Table 27, where the $counter variable is used tomaintain a running tally. Each time the user presses “Increment,” thecounter is incremented.

TABLE 27 Example: Variable Incrementing <sqmlxmlns:sqml=″http:/www.sqgo.com/sqml/sqml.dtd″appid=″com.sqgo.simpleos.demo.helloWorld″ activate=″main:card_main″ ><sqml:sq-class classid=″class_main″ objectid=″main″> <sqml:variablename=″counter″>1</sqml:variable> <!-- The main card --> <sqml:sq-cardid=″card_main″> <sqml:title label=″Variable Incrementing″ /> <sqml:rightlabel=″Increment″ class=″border″ onActivate=″{counter := $counter + 1}″/> <sqml:frame> <sqml:textarea class=”bigtext”> Press Increment toincrease the value: </sqml:textarea> <sqml:textareaclass=”miditalictext”> Current Value is: {$counter} </sqml:textarea></sqml:frame> </sqml:sq-card> </sqml:sq-class> </sqml>

Visually, the output of this program will look something like what isshown in FIG. 16 (see 1602, 1604, 1606).

Variable Assignment Nuances

In the previous example, the incrementing expression{counter:=$counter+1} illustrates an important different between counterand $counter within the expression. The $ tag performs the SQScriptequivalent of a de-reference, looking up the value of the expressioninstead of representing the expression itself. If the expression hadmerely been {counter=counter+1}, SQScript would indicate a runtime errorbecause counter on the left side of the expression indicates a pointerto the variable, not a number that can be added to 1.

Variable Methods and Attributes

Variables support a set of methods and attributes. Methods can be calledon each variable just like a method call to an object or class, andattributes can be accessed using the usual instance variable syntax.

Globally Available Variable Attributes

All variable types support the attributes shown in Table 28.

TABLE 28 Summary Globally Available Variable Attributes AttributePurpose access public | private | protected (default: private) Accessmodifier - works similar to C++ and Java; this only has meaning forvariables declared at the class level. This attribute will cause anerror to be thrown if used with variable declarations in other scopes.final true | false (default: false) If true, value(s) cannot bemodified. For Node type variables, setting final to true means thatattribute values cannot be modified. size Returns the number of items inthe variable; for a scalar variable (<sqml:variable>) the size is alwaysone. To get the length of the String value of a scalar variable, use thelength method.Scalar Attributes

In one practice of the invention, the following attributes (Table 29)are supported by scalar variables.

TABLE 29 Scalar Attributes Method name Purpose length Returns the lengthof the String value contained in a scalar variable. If used as anlvalue, will truncate or pad the string (with spaces) to the specifiedlength. Example: truncates “ice cream” to “ice” <sqml:variablename=”myvar>ice cream</sqml:variable> <sqml:eval expr=”myvar#length :=3”/> tokenize(sep) Splits the string into a series of tokens using theseparators. This should be used as an rvalue in an assignment where thelvalue is the name of a list variable. Anything in the list prior to thestring token operation is destroyed. Example: <sqml:variablename=”mystring”>every good boy deserves fudge</sqml:variable> <sqml:listname=”mylist”/> <sqml:eval expr=”mylist := $mystring#tokenize(‘ ‘)”/>List Methods

List variables support the following methods (Table 30):

TABLE 30 List Methods Method name Purpose Remove(i) Removes the item atposition I removelast Removes the last item removefirst Removes thefirst item Addlast Adds an item at the end of the list Addfirst Add anitem to the head of the list Clear Removes all items from the listAppend Append the items in the rvalue list to the lvalue list. Example:appends list2 to list1 list1#append($list2)

In order to explicitly avoid name collisions between inner and instancescope variables of the same name, this can be specified as an objectqualifier. A variable with the name this is automatically created as aninstance member. The value of this is set to the object ID. A new valuecannot be assigned, nor can any other variable with the name this becreated, regardless of context; i.e., this is a reserved word.

The example of Table 31 demonstrates the use of this.

TABLE 31 Example of “this” <sq-class classid=”thisexample”><sqml:variable name=”myvar”/> <sqml:function id=”init”type=”initializer”> <sqml:param name=”myvar” type=”string”/> <sqml:evalexpr=”this#myvar := $myvar”/> </sqml:function> </sq-class>Introduction to Lists

SimpleOS allows variables to include more than one value. In this case,the variable is called a list. A list can be declared using syntax likethat shown in Table 32.

TABLE 32 Declaring List Variables <sqml:list id=“list_pizzaImages”><sqml:list-element>thincrust.gif</sqml:list-element><sqml:list-element>thickcrust.gif</sqml:list-element><sqml:list-element>deepdish.gif</sqml:list-element> </sqml:list>

The elements of the list may be accessed using array-index syntax, suchas: <img src=“{$list_pizzaImages[1]}”/>. The first item is always 1, thesecond 2, etc. If a list expression appears within an attribute valuetemplate, the template is replaced by the elements in the list,separated by spaces. For instance: <text-labellabel=“{$list_pizzaImages}”/> would generate a label: thincrust.gifthickcrust.gif deepdish.gif. The number of elements in a list can bereturned by using the count( ) function. For example,{count($list_pizzaImages)} evaluates to 3 There are several otherbuilt-in functions for working with lists in SQScript.

List Example

Using arrays, a simple pizza chooser application can be created. Thisapplication will let the user cycle between a list of pizzas on a card,seeing both a photo and a text description of each. Because we have notcovered conditional expressions yet, there is nothing to prevent theuser from cycling beyond the three pizzas we have defined. (This examplewill be revisited later in the section on methods.)

In the source code shown in Table 33, the system maintains a variablecalled “index” that tracks the number of the current pizza.

TABLE 33 Example: Pizza Ordering Version 1.0 <sqml:sq-classclassid=“class_menubase” id=“main”>  <sqml:variablename=“index”>2</sqml:variable> <sqml:list name=“list_pizzaNames”><sqml:list-element>Thin Crust Pizza</sqml:list-element><sqml:list-element>Thick Crust Pizza</sqml:list-element><sqml:list-element>Deep Dish Pizza</sqml:list-element> </sqml:list><sqml:list name=“list_pizzaImages”><sqml:list-element>thincrust.gif</sqml:list-element><sqml:list-element>thickcrust.gif</sqml:list-element><sqml:list-element>deepdish.gif</sqml:list-element> </sqml:list><sqml:sq-card id=“card_menu”> <sqml:title label=“Pizza Menu” /><sqml:top label=“PREVIOUS” class=“border” onActivate=“{index=$index−1}”/> <sqml:bottom label=“NEXT” class=“border”onActivate=“{index=$index+1}” /> <sqml:frame> <sqml:imagesrc=“{list_pizzaImages[$index]}” /> <sqml:textarea>{list_pizzaNames[$index]} </sqml:textarea> </sqml:frame> </sqml:sq-card></sqml:sq-class>

The “next” and “previous” buttons have been wired up to increment anddecrement the index variable. Within the frame definition, an image anda text area extract information from two arrays list_pizzaNames andlist_pizzaImages based on the current value of index. Screenshotscorresponding to this example are shown in FIG. 17 (1702, 1704).

Object Lists, Maps and Vectors

Although lists, hash maps and vectors can only store strings as theprimitive object types, they can in fact be used as very powerfulcollection classes to organize groups of objects. Since all objects havea unique ID, which is a string, creating a list, hash map or vector ofobject IDs is equivalent to storing references to the objects.

By the same token, IDs of XML nodes could also be stored in thesecollection classes, and then the IDs could be used to dynamically buildNode variables to access an object's DOM structure. Be aware, however,that the XML IDs are only guaranteed to be unique within an objectinstance. So be careful not to mix references to different object'sDOMs.

When an object is instantiated using the <sqml:new> statement, anautomatic variable is created in the current scope called newobjectid.The example shown in Table 34 builds a list of objects that containmessages.

TABLE 34 Example: Building a List of Objects <sqml:sq-classclassid=”class1”> <sqml:message id=”msg1”/> </sqml:sq-class><sqml:sq-class classid=”class2”> <sqml:message id=”msg2”/></sqml:sq-class> <sqml:sq-class classid=”class3”> <sqml:messageid=”msg3”/> </sqml:sq-class> <sqml:sq-class id=”main” objectid=”main”><sqml:list name=”objectList”/> <sqml:function name=”init”type=”initializer”> <sqml:new classid=”class1”/> <sqml:evalexpr=”objectList#addlast($newobjectid)”/> <sqml:new classid=”class2”/><sqml:eval expr=”objectList#addlast($newobjectid)”/> <sqml:newclassid=”class3”/> <sqml:eval expr=”objectList#addlast($newobjectid)”/></sqml:function> </sqml:sq-class>Implicit Tree Variables

Certain elements within the tree data of an object also create implicitvariables. Most GUI elements use this approach to provide a way toextract their current value. For instance, a text field declarationautomatically creates a variable with its id: <sqml:text-fieldid=“username” label=“Enter your name” value=“foo”/> The current contentsof the text field can be extracted by referring to $username.

Consider the code example shown in Table 35, which creates a text fieldand a text label. When the “GO” button is pressed, the value of the textfield is copied into the current value.

TABLE 35 Example: Text Field Extraction <sqmlxmlns:sqml=″http:/www.sqgo.com/sqml/sqml.dtd″appid=″com.sqgo.simpleos.demo.textFieldExample″activate=″main:card_main″ > <sqml:sq-class classid=″class_main″objectid=″main″> <sqml:variable name=″currentValue″></sqml:variable><sqml:sq-card id=″card_main″> <sqml:title label=″Text Field Example″ /><sqml:right label=″GO″ class=″border″ onActivate=″{currentValue :=$username}″ /> <sqml:frame> <sqml:textarea>Enter Text</sqml:textarea><sqml:text-field id=”username” label=”Your Text” value=”” /><sqml:textarea>Current Value is: {$currentValue} </sqml:textarea></sqml:frame> </sqml:sq-card> </sqml:sq-class> </sqml>

This example will look something like that shown in the screenshot ofFIG. 18 (1802, 1804), when executed. The user has already entered thestring “Jeremy” into the text field.

Extended Expressions

Just like C and JAVA, SQScript expressions can contain basicmathematical operation. This may include arithmetic as well asmathematical functions. Function use the syntax function( ) where avariable or set of variables is included within the parenthesisseparated by commas.

Some examples of valid expressions with and without functions are shownin Table 36.

TABLE 36 Examples of Mathematical Expressions { foo := 12/16 } { foo :=12/(16+23+19+$bar) } { foo := cos( $bar) }Instance Variables

If a list or scalar variable is declared underneath the class or objectdefinition, the variable becomes an instance variable. This allows it tobe accessed from other objects using the standard element identifiersyntax. In the example shown in Table 37, the object main2 loads thevalues of main:username and main:var.

TABLE 37 Example: Instance Variables <sqml:sq-class classid=“class_main”objectid=“main”> <sqml:sq-card id=“main”> <sqml:title label=“TEST” /><sqml:frame> <sqml:text-field id=“userName” label=“Type Your Name”value=“Jeremy Gilbert” /> </sqml:frame> </sqml:sq-card> <sqml:variablename=“myScalar”>This is a scalar </sqml:variable> </sqml:sq-class><sqml:sq-class classid=“subclass” objectid=“main2”> <sqml:sq-cardid=“main2”> <sqml:title label=“TEST TWO” /> <sqml:top label=“ABOUT US”class=“border” onActivate=“{ui:card=‘main#card_about’}” /> <sqml:frame><sqml:text-label id=“userName” label=“Your Name Is”value=“{$main:userName} and {$main:var}” /> </sqml:frame></sqml:sq-card> </sqml:sq-class>Methods

SQScript methods are almost identical to methods in otherobject-oriented languages. Each method runs inside the variable bindingcontext of the object it was invoked upon. That means that localvariables and data within the object's data tree are locally accessibleto the code of the method. Methods can be invoked within any SQScriptexpression, including from other methods.

Defining Methods

Methods may be defined using the sqml:function tag. Referring now toTable 38, the example object main of class class_menubase defines amethod called previous that decreases the value of the variable index by1.

TABLE 38 Example: Method Definition <sqml:sq-classclassid=“class_menubase” id=“main”> <sqml:variablename=“index”>2</sqml:variable> <function id=“previous”> <sqml:evalexpr=“{index := $index−1}” /> </function> </sqml:sq-class>The Method Body

Within the body of the method, statements can be included in an orderedlist. These statements may include conditional statements, expressions,loops, and other basic programming structures.

When a method is invoked, the statement elements underneath thedefinition are evaluated one-by-one. When the last statement isevaluated, the method terminates.

The most common type of statement within a method body is an evalstatement. The eval statement element takes a single attribute expr thatcontains a SQScript expression. The curly braces are required here andevery other time a SQScript expression is included somewhere within thesuperstructure.

The example of Table 39 demonstrates multiple expressions chainedtogether. At the conclusion of the method, the value of $test will be1111.

TABLE 39 Example: Evaluation Tags in a Method <sqml:sq-classclassid=“base_class” id=“main”> <sqml:variablename=“test”>1</sqml:variable> <function id=“doStuff”> <sqml:evalexpr=“{test=$test+10}” /> <sqml:eval expr=“{test=$test+100}” /><sqml:eval expr=“{test=$test+1000}” /> </function> </sqml:sq-class>Invoking Methods

Methods may be invoked from within any SQScript expression. The syntaxfor method invocation is the name of the method followed argumentsbracketed within a set of parentheses. Even in cases where there are noarguments, the parentheses are needed to denote a method invocation tothe parser.

In the example of Table 40, the method doStuff invokes a second methodcalled helpMe.

TABLE 40 Example: Method Invocation <sqml:sq-class classid=“base_class”id=“main”> <sqml:variable name=“test”>1</sqml:variable> <functionid=“doStuff”> <sqml:eval expr=“{test=$test+10}” /> <sqml:evalexpr=“{:helpMe( )}” /> </function> <function id=“helpMe”> <sqml:evalexpr=“{test=$test+100}” /> <sqml:eval expr=“{test=$test+1000}” /></function></sqml:sq-class> </sqml:sq-class>

In addition, methods may be called using a variety of formats, shown inTable 41.

TABLE 41 Method Invocation Examples main:helpMe( ) Indicates a call tomethod helpMe on main :helpMe( ) Calls method helpMe on the currentobject helpMe( ) Calls method helpMe on the current objectVariables Scope

Scalar and list variables may be declared inside methods. Thesevariables are not visible outside of the method under any circumstances,and are only available to code within the method. If a variable within amethod (or a block) has the same name as a variable outside of the blockor a method, the variable will obscure the definition further away fromthe currently executing code.

When the code shown in Table 42 runs, the inner copy of test isincremented, not the outer copy of test. However, it is still possibleto reach outer instances of variables by using element syntax. The codeshown in Table 43 increments both instances of $test.

TABLE 42 Variable Masking <sqml:variable name=”test”>0</sqml:variable><function id=″doStuff″> <sqml:variable name=”test”>0</sqml:variable><sqml:eval expr=″{test := $test + 10}″ /> </function>

TABLE 43 Variable Masking with Element Identifiers <sqml:sq-classclassid=″base_class″ id=″main″> <sqml:variablename=”test”>0</sqml:variable> <function id=″doStuff″> <sqml:variablename=”test”>0</sqml:variable> <sqml:eval expr=″{test := $test + 10}″ /><sqml:eval expr=″{main:test := $main:test + 10}″ /> </function></sqml:sq-class>Declaration Order

The order of the variable declarations is not critical. The portions ofcode shown in Table 44 are equivalent and both valid.

TABLE 44 Examples of Declaration Order <function id=″doStuff″><sqml:variable name=”test”>0</sqml:variable> <sqml:evalexpr=″{test=$test+10}″ /> </function> <function id=″doStuff″> <sqml:evalexpr=″{test=$test+10}″ /> <sqml:variable name=”test”>0</sqml:variable></function>

This results from the fact that variable declarations are not statementsand are not parsed at the time that the statements are evaluated. Beforea line of code inside a block is ever interpreted, the variables insideare collected together to provide a context object for the evaluator.The context object does not care where the definition occurs, only whereit is within the block structure.

Blocks and Variable Scope

Most looping and conditional statements create new variable contextwhere it is possible to mask variable names. Within a method, variableswill bind to their closest block. Consider the example shown in Table45. Here, the assignment {$index:=1} within the if block will onlyupdate the inner index variable.

TABLE 45 Blocks and Variable Scope <function id=″next″> <sqml:variablename=”index”>0</sqml:variable> # Not updated  <sqml:eval expr=″{index :=$index+1}″ />  <sqml:if test=″{$index > 5}″> <sqml:variablename=”index”>0</sqml:variable> # Updated <sqml:eval expr=″{$index := 1}″/>  </sqml:if> </function>Conditional Statements

One of the most basic control structures is the if block. The if blockonly evaluates expressions inside of the block if the test attributeevaluates to true. The if block begins by running the code within thetest expression. If the result is true, the evaluator is allowed tocontinue into the block. Otherwise, the block is skipped. Conditionalstatements only work inside methods.

In the example shown in Table 46, the variable numItems is checked. Ifthe value is greater than 100, the variable $message is updated.

TABLE 46 Example: If Block  <sqml:variablename=”numItems”>0</sqml:variable> <function id=″checkLabel″>  <sqml:iftest=″{$numItems > 100}″> <sqml:eval expr=″{message := ‘You have toomany items’ }″ />  </sqml:if> </function>Loops

SQScript can also support looping structures.

Pizza Ordering Revisited

The example shown in the screenshots of FIG. 19 (1902, 1904, 1906)demonstrates a number of concepts. The application allows the user tocycle through a set of three pizza selections. However, unlike theprevious pizza ordering example, this version maintains a check toensure that if the user goes past the last item in the list, theselector will wrap back to the first item.

The example of code shown in Table 47 operates by defining two methods,next and previous, that increment or decrement a counter with thecurrent pizza name. They also contain a check to reset the value ifneeded.

TABLE 47 Example: Pizza Ordering Revisited <sqml:sq-classclassid=“class_menubase” id=“main”> <sqml:variablename=“index”>2</sqml:variable> <sqml:list name=“list_pizzaNames”><sqml:list-element>thin crust pizza</sqml:list-element><sqml:list-element>thick crust pizza</sqml:list-element><sqml:list-element>deep dish pizza</sqml:list-element> </sqml:list><sqml:list name=“list_pizzaImages”><sqml:list-element>thincrust.gif</sqml:list-element><sqml:list-element>thickcrust.gif</sqml:list-element><sqml:list-element>deepdish.gif</sqml:list-element> </sqml:list><sqml:sq-card id=“card_menu”> <sqml:title label=“Pizza Menu” /><sqml:top label=“PREVIOUS” class=“border” onActivate=“{previous( )}” /><sqml:bottom label=“NEXT” class=“border” onActivate=“{next( )}” /><sqml:frame> <sqml:image src=“{list _(—) pizzaImages[$index]}” /><sqml:textarea> {list _(—) pizzaNames[$index]} </sqml:textarea></sqml:frame> </sqml:sq-card> <sqml:variablename=“index”>1</sqml:variable> <function id=“next”> <sqml:evalexpr=“index := $index+1” /> <sqml:if test=“$index >$list_pizzaNames:size”> <sqml:eval expr=“$index := 1” /> </sqml:if></function> <function id=“previous”> <sqml:eval expr=“index := $index−1”/> <sqml:if test=“$index = 0”> <sqml:eval expr=“{index :=$list_pizzaNames:size}” /> </sqml:if> </function> </sqml:sq-class>Inheritance

SQScript supports the object-oriented programming concept of inheritancebetween classes. Each object that has been instantiated in the systembelongs to a class. When methods and variable lookups occur on anobject, the definition for the lookup is found by searching theinheritance tree starting at the object. First the class is searched,then the super-classes in order.

When an object is cloned from another object, the new object assumes theclass of the original.

Inheritance does not serve any typing ability. Classes exist asorganizational means for grouping methods and data members.

Creating Objects

Object manipulation is an important aspect of the SQScript language,since objects serve as the basic grouping for data within thesuperstructure. When the process is first loaded, there are no instancesof any objects except the implicit objects. Each class is loaded intomemory, and one of them is used to create the initial object. Aprogrammer must declare at least one class within the SQML source tohave an objectID. This causes an instance of the class to beautomatically generated at runtime.

After the SimpleOS program starts, the developer may create additionalobject instances. Objects are created from templates, which can beeither another object or a class. If the template for a new object is anexisting object, the new object can become a carbon copy of the oldobject. The new object will assume the same class affiliation as the oldobject. If the template for a new object is a class, all of the datavalues within the class are copied over into the new object.

No two objects in the process's superstructure may have the sameinstance name. If a new object is created with a pre-existing instancename, the old object is completely replaced by the new object. In somecases, a programmer may wish to create a temporary object and want toensure that the name does not conflict with a previously created object.A special programming primitive allows the programmer to create a newname for an object that is guaranteed to be unique.

Syntax

The basic object operation is “instantiate.” This operation takes anobjectid attribute that describes the new instance name for an object.The source attribute can be used to specify either the class or objectid that forms the template for the new object. For example, and withoutlimitation, code for instantiating an object may be provided as:<function id=“makeObject”> <sqml:instantiate objectid=“options”source=“class options”/> </function>.

Initializers

When an object is first instantiated, a method on it called initializeis called. This gives the object an opportunity to perform any initialconfiguration.

VI. Superstructure Operations

Object Transformations

SimpleOS provides an advanced means for object manipulation calledobject transformation. Object transformation is similar to the normalprocess of object instantiation, however an additional processing passis taken before the object is created. A transformation is a complexexpression organized as a dynamic template that maps old data valuesonto new data values. The template contains embedded expressions thatallow nodes to be reorganized, repeated, manipulated, and altered.

During an object transformation, a template (represented as a tree) isloaded from the superstructure. This template describes a functionalmapping between an existing object and a new object. When SimpleOSevaluates an SQScript template during an object transformation, variousinstructions within the template cause substitutions within thistemplate. Substitutions can include finding other data within the tree,looping and indexing, conditional expressions and other commonprogramming structures. Once the template has been filled out, theresulting value becomes the definition for the new object.

Partial Transformations

For efficiency, SimpleOS also allows a transformation to express a“clipped” tree instead of the complete definition of a new object. Inthe clipped tree model, the result of a template transformation is apartial list of updates that are selectively folded back into theobject. A clipped tree is not a sub-tree. It faithfully follows theroot-to-node structure and naming of the elements within the object.However, the clipped tree can be sparse—it does not have to includeunaffected siblings or sub-trees. Every node in the clipped tree musthave an expressed path to the root, but only the nodes that must beupdated, changed, or deleted need to be in the clipped tree itself.

One advantage of partial transformations is the ability to track thestate when the clipped tree is applied to the object. The foldingprocess tallies all of state changes as the tree is updated. Thisprovides rich information that SimpleOS uses to create a minimal set ofwork required to perform changes to the environment. This list ofchanges can be used for optimal GUI updating and for applying rulesabout how the user interface migrates from one state to another throughanimation, etc.

Messaging

Messaging is a special type of instantiation of a class over a network.The term messaging, as used in this concept, is entirely unrelated toMessage Queues or event messages used by SimpleOS. In this context,messaging refers only to network communications. The target of a messagecan be a device or a server. Therefore, it is necessary for allimplementations of SimpleOS and SimpleServer to provide the SQScriptenvironment.

A message is an SQML document containing one or more SQClass templates.The type attribute for the <sqml> element is message. SimpleOS generatesthe required appid and sessionid attributes. In addition, SimpleOS willalso provide a certification digest that is not documented here forsecurity reasons.

Table 48 shows an example of a message.

TABLE 48 Example: Body of a Message <sqmlxmlns:sqml=″http:/www.sqgo.com/sqml/sqml.dtd″appid=″com.sqgo.simpleos.application.sample1″sessionid=”8A7B6C5D4E3F8A7B6C5D4E3F8A7B6C5D” doctype=”message”><sqml:sq-class classid=”class_main”> <sqml:message id=”msg”> Some randomtext data </sqml:message> </sqml:sq-class> </sqml>

A number of factors are to be considered with regard to messages:

-   -   The objects in the message are instantiated on the target, not        the source.    -   All objects are automatically instantiated for all classes        defined in the message body and any initializer functions are        executed.    -   Other functions within the instantiated objects may be invoked        by the target scripting environment.    -   Object IDs are automatically assigned by the target system—any        values supplied for the <sqml:sq-class> or <sqml:new> objectid        attribute are ignored. The reason this is necessary is that the        source (which emits the SQML) cannot be aware of the object        namespace that exists on the target.    -   The message is actually serialized from the application's        internal DOM structures into the text representation of SQML        prior to sending over the network. The transport protocol is        assumed to be a request/response type of protocol like        HTTP/HTTPS. The response may be a simple acknowledgment, or it        may be another SQML formatted message, depending on the needs of        the application.        It is recommended that messaging occur over a secure connection        whenever possible, and that the connection be protected by a        digital certificate of verifiable origin.        Intrinsic Methods

In the JAVA programming languages, all objects are ultimately inheritedfrom the base class called Object. The Object class carries with itcertain methods that are therefore available to all JAVA objects. It isnot necessary for any class to specifically name Object as asuperclass—it is implied in the language.

In SimpleOS, objects also inherit from an implied base class, althoughthis class does not have a name. Methods from this class are availableto any class defined in SQScript. The intrinsic methods are shown inTable 49.

TABLE 49 Summary of Intrinsic Methods Method name Purpose getobjectidReturns the object ID associated with this object instance. getclassidReturns the class ID associated with this object instance. getsuperidReturns the class ID of the super class, if any. getinterfaces Returns alist of interfaces implemented by this object. Should be used as anrvalue, with a list variable as the lvalue. Any items existing in thelist prior to the call will be destroyed. save Serialize this object toits XML representation load Restore this object from its serializedform; returns the new object ID.Object Serialization

Object serialization in SimpleOS is designed to rely upon XML.Ultimately, all SimpleOS objects will be serializable in XML form,although this feature is not implemented in the reference implementationand may not be for several releases.

Ideally, serialized applications, and even processes, could be movedfrom device to device without interrupting operation.

Two intrinsic methods are provided for object serialization: 1.save—automatically creates message objects within the DOM that carry allinternal object data, and then writes the DOM as XML text. 2. load—readsserialized XML text and restores the internal data structures.

A special version of the <sqml> element provides the wrapper forserialized objects. Multiple objects can be saved in one SQML stream.The example of Table 50 shows a serial data stream representing objectsand classes inside a message.

TABLE 50 Example: Serialized Data <sqmlxmlns:sqml=″http:/www.sqgo.com/sqml/sqml.dtd″appid=″com.sqgo.simpleos.application.sample1″sessionid=”8A7B6C5D4E3F8A7B6C5D4E3F8A7B6C5D” doctype=”object”><sqml:sq-class classid=”class1”> <sqml:message id=”sqgocontext_123A4F9”>... Actual data not shown ... </sqml:message> </sqml:sq-class> </sqml>

VII: Network Communication and Remote Execution

The following discussion describes ways in which SimpleOS can be used tosupport network communication and remote execution. Again, it isintended to illustrate and provide examples of implementation of thebroader concepts of the invention, particularly as they relate tosuperstructure-based application environments. Accordingly, while thefollowing discussion is based on SimpleOS and related examples, it willbe understood that the principles illustrated can be implemented in awide range of different configurations, all within the ambit of thepresent invention.

SimpleOS provides a novel model for network communication between theclient and server if an application calls for such interaction. Thedeveloper is free to write server-side logic in any XML-enabled serverprogramming language including JAVA, C++, PERL, TCL, SHELL and manyothers. Using an innovative methodology, small pieces of the applicationsuperstructure itself are shifted back and forth between the device andthe server, allowing virtually any operation on the device to beperformed by the server. This complete flexibility allows the programmerto adopt any request/response paradigm he chooses. Because of theabstraction offered by the application superstructure, the developer hascontinuous flexibility to locate application logic either on the deviceor on a remote server.

Simple Quick GO transcends the existing client server and HTTP-basedcomputing architectures. In client/server the primary exchange is datain some private or public form. In HTTP, the exchange is HTML and forminformation that conforms to HTTP. However, SimpleOS exchanges actualpieces of the application, large or small. Messages from the serverincrementally update the application superstructure through the samefolding process used by object transformations.

When a running application needs to communicate with a server,pre-selected objects from the process's superstructure are automaticallysent to the remote site along with the event object. The remote server'scode has access to any data that it needs since the same applicationsuperstructure available on the device has been transferred over thenetwork. If the server needs to produce some change on the device, itcan send a minimal set of changes back to the device along the samecommunication channel. These changes are applied to objects in thesuperstructure in the same way that code running on the device canupdate the superstructure using the transformation model. This entireprocess works automatically since it is hooked into the transformationengine used for object transformations.

In the remote execution model, messages normally delivered to theclient's code are shipped to a remote server. In client-side operation,user events typically cause a message descriptor to be identified andfilled out to produce a message object, which is handled as an argumentto a template-based transformation. In the remote model, this messageobject is serialized into SQML (or any suitable, equivalent transportmechanism) that is sent to the target using any of the supportedprotocols. The server reconstitutes the device's message object from theSQML and performs its processing. Because SimpleOS includes anyarbitrary copy of objects inside the application's superstructure, theserver has access to all of the information it needs to process arequest.

After processing a request, most applications typically call for anupdate of the application to confirm the action or refresh a display.SimpleOS handles the return update by allowing the server to construct aresult-tree object that minimally describes the necessary changes to anyobject within the superstructure. This result-tree object is the samedata structure produced via template evaluation on the device. Theserver converts this response into SQML and sends it back to the devicewhere it is un-marshaled and applied to the superstructure. Because ofthe parity between the client and remote execution model, any activitypossible in client code is also possible on the server.

Server Components

In one practice of the invention, to assist with secure remoteapplication processing, Simple Quick GO will provide a J2EE-compliantcontainer that performs the work of translating messages from devicesinto a common form and then transmits a response back from program code.The present implementation, available first on the APACHE/TOMCATplatform, should work on any J2EE-certified application server platform.Developers can write JSP files or JAVA classes that can receive messagesand perform updates on applications running under SimpleOS.

In one practice of the invention, the SimpleQuickGO Server platformmaintains a state-full session bean for each active SimpleOS applicationthat has started a networking session. Every time a SimpleOS clientapplication sends a message to the server, the software locates theindividual session bean associated with the application. This sessionbean receives all communication from the client and delegates messagesto application-specific code. By extending Simple Quick GO's sessionbean interface, the developer can build any type of server-sidefunctionality. The server platform is also responsible for securing thecommunication. (See Security section.)

In a further practice of the invention, the application server maintainsa set of JSP utilities and tag libraries to simplify the creation ofSQML-based responses to the device. These utilities help parse messagesfrom the device and construct the correct responses.

The application server provides an extensive set of services to aid inthe provisioning of applications. The server can maintain a registrationof known programs and known terminals, and can field provisioningrequests from devices that wish to load a new program. The server thenwill help choose and merge the stylesheets that apply to the particulardevice and create the provisioned application object. In some cases,media assets (such as sounds, images and animations) require additionaltranslation, for instance an image may need to be resized on the serverbefore it is sent to the device.

Other Options

The SimpleOS network communication model can also work without the J2EEserver component. Since the message transfer format is entirelyXML-based, any programming language capable of receiving XML over thenetwork and emitting XML in response should be able to communicate witha SimpleOS application.

Updating Application Segments and Resources

SimpleOS applications can be dynamically updated. Portions of theapplication may be added, removed, or replaced. However, changes aremade in the application object, so they do not become apparent until anew process is activated.

The mechanism for modifying an application involves sending a particulartype of SQML document to the device, known as a fragment. A fragmentcontains portions of the application that will be changed. If theelement structure defined by the fragment is new, it is added to theapplication. If the element structure already exists, the old elementstructure is first deleted and then replaced with the new structuresupplied in the fragment. If the element structure in the fragment isempty, then the corresponding element structure is removed from theapplication.

A fragment may consist of one or more sq-class definitions, and/or astyle sheet. Individual items within classes or style sheets cannot beupdated. Developers should be careful not to create fragments thatdamage the integrity of the application's structure. While some checksare made (for example, not allowing referenced superclasses to bedeleted), complete verification by SimpleOS is impractical.

Table 51 shows a fragment that would add or update a simple class in anexisting application.

TABLE 51 Using Fragments to Update an Application <sqmlxmlns:sqml=″http:/www.sqgo.com/sqml/sqml.dtd″appid=″com.sqgo.simpleos.application.sample1″ doctype=”fragment”><sqml:sq-class classid=”class1”> <sqml:list name=”mylist”/> <functionname=”init” type=”initializer”> <sqml:evalexpr=”mylist#addlast(‘abc’)”/> <sqml:eval expr=”mylist#addlast(‘it iseasy as’)”/> <sqml:eval expr=”mylist#addlast(‘123’)”/> </function></sqml:sq-class> </sqml>Client/Server Example

Fragments can be used as the basis of an automatic style ofcommunication between an application and a remote server. The followingexample demonstrates how the client device and the server might work ina fictitious example called NewsSubscribe. This application queries auser for a name and email address and then submits the data to a remoteserver. The application is very simple, and all of the communication inthis example is automatic. Aside from the initial setup described below,no additional set-up is required.

The following is merely a hypothetical example, in which the grammarutilized does not necessarily correspond to that described above(thereby illustrating that various grammars can be utilized inaccordance with the invention). Note also that the following exampledoes not show the object-level grouping described above. The exampledoes, however, demonstrate a method of using fragments to accomplish thedesired result. The reader should also note the method of using objectsto implement this function, as described above in the discussionsregarding messaging. Other examples are, of course, possible andconsistent with the invention. In this example, the following nodesdescribe the application (see Table 52):

TABLE 52 Nodes Node Name Description Attributes news.gui The GUIhandler, currentScreen=screen1 set to use screen1 as the current screen.news.gui.screen1.fullName The GUI label to type=textfield receive thefull value=”” name prompt=”Full Name:” news.gui.screen1.email The GUIlabel to type=textfield receive the email value=”” address prompt=”EmailAddress:” news.gui.screen1.submit The GUI button to type=submit submitthe data prompt=”Submit” news.mdesc.submitDesc The messageSource=news.gui.screen1.submit descriptor Type=onActivateTarget=http://myserver.com/sys Context=news.gui.screen1news.gui.screen2.thankYou A GUI label on a “thank you” screenThe interaction could occur as follows:

1) The user downloads or starts up the Subscribe SimpleOS application;

2) The application loads and presents a screen to the user with a promptfor a full name and email address;

3) The user enters this information and presses “submit”;

4) The system consults news.mdesc.submitDesc and forms a new messageobject:

<sqml> <message id=”news.temp1.message” caller=” news.mdesc.submitDesc”><context path=”news.gui”> <screen id=”screen1”> <textfield id=”fullName”value=”Jeremy Gilbert”/> <textfield id=”email” value=”jeremy@sqgo.com”/><button id=”submit”/> </screen> </context> </message> </sqml>

5) The system checks for an existing connection tohttp://myserver.com/sys. Finding none, it establishes an HTTP connectionto the server and provides an handshake message to the server such as:<sqml> <network-control seq=0 type=“http” action=“begin”terminalid=“A23BE3FEC23223A”/> </sqml>;

6) The remote server sets up a new session handler for the “news”application, and returns the following message: <sqml> <network-controlseq=1 type=“http” action=“begin-connect” terminalid=“A23BE3FEC23223A”sessionid=“B44023957FA992E4EE” application=“news”/> <sqml>;

7) Now the application sends the message object it formed earlier, withnetwork control information.

<sqml> <network-control seq=2 type=”http” action=”handleEvent”terminalid=”A23BE3FEC23223A” sessionid=”B44023957FA992E4EE”application=”news” /> <message id=”news.temp1.message” caller=”news.mdesc.submitDesc”> <context path=”news.gui”> <screen id=”screen1”><textfield id=”fullName” value=”Jeremy Gilbert”/> <textfield id=”email”value=”jeremy@sqgo.com”/> <button id=”submit”/> </screen> </context></message> </sqml>

8) The server passes a parsed XML DOM object to the remote NewsSubscribecode. This code adds the name and email address into a database. At thispoint, the server can send any update back to the device it wants. Itcould download additional parts of the application if it wanted to,reconfigure the user interface in any manner, etc. However, in thiscase, we just want to change the current screen attribute from screen1(the submit screen) to screen2 (the thank you screen.) The server willcreate a result tree that performs this modification. The entire networkmessage will look like this. The boldface item shows the desired change.

<sqml> <network-control seq=3 type=”http” action=”update”terminalid=”A23BE3FEC23223A” sessionid=”B44023957FA992E4EE”application=”news” /> <application id=”news”> <gui id=”gui”currentScreen=”screen2”/> </application> </sqml>The client receives this clipped tree and folds it back into thesuperstructure. The screen changes from screen1 to screen2 and the useris shown a “thank you” message.

It will be understood that the implementer is free to develop his or herown methods of securely transmitting clipped tree fragments back andforth across the network. In other network update models discussedherein, instead of exchanging fragments, the two communications partnerscould exchange entire objects stored within the superstructure. In thiscase, sending an object from one to another instantiates that object inthe receiving superstructure, replacing any previous definition of thatobject.

VIII: Security

The following sections survey various technology aspects of SimpleOSincluding security, stylesheets, and embedded systems.

Security Features

Runtime Security

Several fundamental design aspects of the SimpleOS container ensure thatit is inherently resistant to almost all of the runtime security issuesthat plague modern operating systems such as WINDOWS. There are twoprongs to this advantageous design—the enclosed functionality and thepresence of an intermediate form. These two advantages give SimpleOS alevel of security similar to that of other enclosed languages like pureHTML, JAVA applets and FLASH.

Enclosed Environment

Enclosed execution models, such as SimpleOS, HTML, Flash, and JAVAapplets, are inherently secure because they allow the programmer to doalmost nothing outside of a well-defined container. In HTML withoutJAVASCRIPT, the only ability is to present a page and cause images to bedownloaded. JAVA applets cannot access the local file system, interactwith other processes or systems, issue spurious network connections oropen unwanted windows. Although there are exceptions in the case ofFLASH, even with this technology it is relatively true that the onlycapabilities allowed are restricted network communication and theguarded ability to make animations and multimedia presentations.

SimpleOS follows in the tradition of programming languages that discardgeneral features in return for greater security. Within a SimpleOSapplication, the only manipulations possible are those within theapplication's superstructure. This is confined to managing a userinterface with pre-defined controls, playing sounds and animations andperforming certain authorized telephony and network communicationoperations. Tree manipulation is the extent of the ability of a SimpleOSapplication. An analogy would be a web page that contains nothing butHTML and the ability to only change the HTML. In this scenario, it isvirtually impossible to perform a bad operation. The worse that couldhappen in a situation like this is that the application runs away in aninfinite loop. The worst that can happen in a situation like this isthat the application runs away in an infinite loop.

Unlike a general-purpose language such as VISUAL BASIC, C, C++ or J2SE,there simply isn't the means to express inside the language anyoperation outside of its specification. If SimpleOS does not explicitlyprovide for an operation to occur, it is impossible for the applicationto find a way to do it since the application relies entirely on thesuperstructure and SimpleOS to perform all of its work. This is not truein C or C++, which can run code directly on the processor and accessthousands of API toolkits that can perform various operations. Becauselanguages like C/C++ and VISUAL BASIC operate in environments that aremeant to give the programmer general-purpose functionality, it is veryeasy to find holes in the tens of thousands of features inside theenvironment. SimpleOS, not being a general-purpose environment, does notsuffer from the proliferation of toolkits and their concomitant securityrisks. Incidentally, SimpleOS does allow Turing-equivalent generalcomputation—it simply restricts access to the environment from thecomponents capable of computation.

C and C++ also suffer from the difficulty of being processor native,which means that they have full access to main memory, registers andother aspects of a system close to the hardware. Operating systems mustspecifically cordon off C or C++ application from unwanted activity, andmany security holes appear because the cordon is not as tight as itshould be. These languages must be confined by a negative security modelthat relies on restraining activities. Interpreted environments such asSimpleOS rely on a positive security model where only the operationsthat have been considered by the designer are allowed inside thelanguage.

C/C++ Application toolkits present a high security risk because thereare so many of them and they frequently pass data from caller to callerin a low-level binary format. SimpleOS does not provide any API toolkitsat all, and does not suffer from this risk in the same way as a binaryruntime environment.

SimpleOS also provides a security advantage in that it does not allowany low-level processor operations to occur. The only direct workpossible from within a SimpleOS application is the rearrangement oftrees.

Intermediate Form

The second major security aspect of the SimpleOS design lies within itsintermediate application data structures. In SimpleOS, there is nodirect correlation between program code and anything from the hostenvironment. This provides a level of security that would normally befound only in static languages such as non-JAVASCRIPT enabled HTML.SimpleOS is unique among almost any other dynamic language in thestrength of this separation.

Even in a language as well protected as JAVA, emulated virtual machineinstructions are eventually translated to corresponding nativeoperations. This translation exposes a potential risk that bad datagenerated within the container might be copied without protection intosystems outside of the container. This can expose weakness in the APItoolkits of the host environment to malicious code within a container.This type of problem is difficult to contain since the translationtypically occurs in a wide variety of places within the emulator.

The key to SimpleOS's data separation between program code and guardedAPI calls lies in the structure of the SimpleOS execution model. WithinSimpleOS, an application's only possible operations are treetransformations. The immediate result of any executed code withinSimpleOS is never more than a modification to the application'ssuperstructure. Only after the code has completed does SimpleOS engagein a synchronization task, where changes made are carefully extractedand API calls issued the host operating system. During this pass,SimpleOS has the complete freedom to examine and restrict theapplication before the host operating system is ever invoked to performan update. This extra pass provides a unique security advantage overother languages.

Once again, a SimpleOS application only has control over an intermediateform, and cannot touch the underlying interface that allowscommunication with the user and other devices. SimpleOS always makes theactual manipulations within the host operating system on behalf of theSimpleOS application.

The intermediate form found between the application's code and the hostoperating system is entirely based on an XML Document Object Model.There is very little possibility for rogue data to be added to thismodel since all data types are explicitly marked. A united set ofprogramming interfaces governs the extrication of data during therendering process. Because all arguments are extracted from a singlecommon model, it is easy to provide a central clearinghouse within theimplementation to check data before it is used in the platform-nativesections of the SimpleOS code. HTML also benefits from this strongseparation, and that is why 100% pure HTML rarely has been known toprovide a security fault. When such faults occur, they are easy toidentify and repair. Just like SimpleOS, HTML never produces animmediate list of instructions in a host environment when it is loaded.Instead, an intermediate form is produced first. This intermediate formis examined and used by a rendering engine to produce a final form. Anyimplementation of software is subject to development defects that couldexpose a security weakness. An effective approach for dealing withsecurity issues is to address them by design, and the SimpleOS designmethodology uses the very best defenses against programmatic error. Byproviding functionality containment and an intermediate form, SimpleOSis one of the most secure programming environments.

Incorporation of Additional Security Features

The present invention also allows for a number of additional features toimplement security, which are useful, among other applications, inaddressing the security concerns of an operating system run on wirelessdevices. There are several classes of security threats and means toaddress them, as shown in Table 53.

TABLE 53 Summary of Security Threats and Responses Threat TypeDescription Security Approach Interception of Intruder obtains sensitiveIf the communication sensitive data information such as credit mediumused does not cards, personal information, support encryption, accountsnumbers, etc. SimpleOS will use a security library to provide RSAencryption. Man-in-the-middle Intruder causes a client's Messages to thedevice must Attack information be redirected be signed with an MD5through a compromised digest that is verified before system thatattempts to the content is used. modify or insert unwanted code over thenetwork. Buffer overflow Intruder runs code that uses Not possible (orat least, attempts to string arrays that exceed an extremely unlikely)for Java overwrite internal buffer, causing code based architectures. Innon- sections of sections to be overwritten. Java architecture, the onlySimpleOS code buffer over-runs possible are in XML data, so a centralplace to verify buffer checking can be found in the code. This willreduce the risk of buffer-overflows. Fatal Intruder runs code that Tightchecking of the programmatic attempts to divide by zero or expressionevaluation code. errors perform some other Using existing, well-functional impossibility. reviewed code for the expression language (forinstance, longstanding commercial implementations of XPATH) will reducerisk considerably. Infinite Loops, Intruder runs code with Limitedability within Stack looping constructs that do not expression languageto create Overflows terminate or runs an unbounded loops. Becauseunbounded recursive all data structures are part of function. an XMLparse tree, an excessive number of repetitions of data structures willcause application errors within the XML implementation. Unwanted deviceIntruder runs devices that Certificate model will interaction dialunwanted phone prevent access to anything numbers, erase address outsideSimpleOS without an books, etc. authorized certificate. Unexpected APIIntruder writes code to Extremely unlikely because interactionmanipulate the API in such a the only action possible by way thatSimpleOS crashes the programmer is to modify or causes unwanted behaviora tree. (See discussion of intermediate form below.) Unwanted nativeIntruder writes a native code A certificate system will code plug-insplug in that performs protect any dynamically unwanted behavior. linkednative code plug-ins. Viruses Intruder writes self- A certificate willbe needed replicating code. to access other applications besides the oneprovisioned on the device. Consequently, the ability for one program toinfect another is impossible unless a rogue certificate is acquired. Inaddition, since SimpleOS will always prompt the user to allowdevice-to-device communication, the spread from one device to another isunlikely. Rogue Certificate Intruder illegally acquires a Eventually acertificate code signing certificate and revocation system can be usesit to distribute code that implemented within performs unwanted behaviorSimpleOS to provide an additional level of verification for acertificate Trojan Horses Intruder writes an application Applicationsare limited in that appears to perform one the activities they can task,but is secretly perform outside of the performing another. SimpleOScontainer, but if a mobile operator wants to be particularly careful,they can prevent SimpleOS from installing any non-authorized programs.“Spyware” An application sends back If desired, network private data toa central communication can be server without the user's configured torequire a knowledge. special authorization certificate.Hash Signing

In one practice of the invention, to prevent security attacks where arogue server provides unwanted data to an application, all networkcommunication can be secured with a cryptographic MD5 hash. This hash isbased on a shared private key that is exchanged when the application isfirst provisioned. All messages exchanged between the device and theserver must be signed by this hash, and any message exchanged betweenapplications must contain the application's hash.

MD5 is known as a cryptographic digest. When the algorithm is run over amessage, the function produces a short signature. Even the smallestdifference between two nearly identical messages will cause a vastdifference in the value of the digest. The difference is impossible topredict in advance without resorting to lengthy combinatorialcode-breaking, so the hash signature does an excellent job of assuringthat a message contains its original content.

At application provisioning time, the server and the client set up aprivate key shared between them consisting of several hundred bytes ofrandom numbers. Before a message is exchanged, the sender computes theMD5 hash of the concatenation of this key and the message. It sends theresulting hash code and the message together. The receiver adds theprivate key to the received message and checks to ensure that the codeis the same. In this manner, the MD5 signature provides a reasonableguarantee that the message has not been tampered with and that it camefrom a source that knows the private key.

Encryption

Most transmission protocols used by wireless carriers maintain some sortof pre-existing encryption mechanism. Because SimpleOS will use thecommunication means available to it from the host operating system, thiswill cover protecting the data from unwanted interception.

In cases where the host does not provide security, Simple Quick GO hasinvestigated several very lightweight implementations of SSL (SecureSocket's Layer) available in C and JAVA. Such an implementation will beused to secure data transmission.

Certificates

In one practice of the invention, depending on the needs of the mobileoperator who deploys SimpleOS, applications can be restricted in theiroperation unless they were provisioned with a cryptographic certificate.In such a scenario, each application provisioning server would berequired to provide a class-3 digital certificate, signed by SimpleQuick GO in order to secure and encrypt the transfer of an applicationto a device. Furthermore, the application may be limited to certainfunctions based on the type of certificate they are provisioned with.

Functions that can be optionally limited for a particular install baseinclude:

-   -   Network access    -   Access to phone and telephony features such as the address book        and initiating a phone call    -   Access to other applications deployed in SimpleOS    -   Ability to use local area network communication (BlueTooth,        802.11B)    -   Ability to load and use dynamic code    -   Ability to install and run an application    -   The ability to do any of the previous without explicit user        confirmation        Certificate technology has been used successfully by JAVA        applets and MICROSOFT ACTIVEX technologies to limit the ability        of unwanted code to run on a device. A detailed description of        digital certificate technology is beyond the scope of this        document, but a brief description follows. A central authority        responsible for an installed based of SimpleOS deployments        maintains a certificate server and an issuing office. This        central authority (CA) might be a carrier, mobile operator,        device manufacturer or Simple Quick GO itself. Developers        approach the CA asking for a particular certificate (such as a        certificate to perform telephony.) The CA will issue this        certificate to the developing organization, which uses the        certificate to cryptographically sign each application. This        signature is recognized by the SimpleOS container and verified        before performing a restricted activity.

To promote the widespread expansion of the SimpleOS container, an overlyrestrictive policy may not be recommended. Only the most dangerousoperations such as installing an application or adding dynamic codemight require certificates. It is expected that mildly risky activitieswould require a simple confirmation from the user before they areperformed. In the case of an action requiring a certificate, userconfirmation will not be required.

Certificates are used to maintain a chain of responsibility. If codethat has a valid certificate is found to contain a virus or otherdangerous code, the owner of that certificate can be traced. Since thecertificates are hard to forge, it allows an operator to havecryptographic certainty that only authorized developers are performingdangerous operations on a device. Applications can sometimes beprovisioned in a peer-to-peer arrangement instead of from the server. Inthis case, the certificate is transferred along with the applicationinside the resource stream that provisions the application.

IX. Stylesheets

While stylesheets are not necessary to a basic superstructure-basedapplication environment, their use is of great utility to producing ahighly functional implementation of the invention. Accordingly, oneembodiment of SimpleOS employs a style-sheet mechanism for thedefinition of colors, fonts and other presentation attributes of userinterface elements. This allows the presentation of the GUI to beseparate from the description of the GUI components. This same approachhas been successfully used in other areas of web technology, notablyHTML.

A stylesheet groups sets of formatting properties such as fonts, colorsand layout into a style classes. Each element in the GUI is associatedwith a style class, which provides that element with its presentationattributes. (A default style class is associated with any GUI elementthat does not have an explicit class.)

The example of Table 54 shows a very basic SQML application that uses adefault stylesheet to establish parameters for a set of frame buttons.Each frame button will inherit from the class since it is marked“default”.

TABLE 54 Simple Stylesheet Example <?xml version=“1.0”encoding=“UTF-8”?> <!DOCTYPE sqml SYSTEM “sqml.dtd”> <sqmlappid=“com.sqgo.simpleos.application.launcher”> <sq-style-sheet> <classdefault=“true”> <palette> <colordef name=“blue” rgb=“#4444ff”/></palette> <bgcolor color=“blue”/> </class> </sq-style-sheet> . . .<sq-card id=“card01”> <top label=“TOP” id=“top”/> <left label=“LEFT”id=“left”/> <right label=“RIGHT” id=“right”/> <bottom label=“BOTTOM”id=“bottom”/> <frame id=“frame01”> </frame> </sq-card> . . . </sqml>

SimpleOS stylesheet classes exist in an inheritance hierarchy, whichallows one class to extend another. This allows a developer to quicklymodify the look and feel of an application. For instance, the developercould define a base stylesheet for a set of applications, and createsub-classes of that stylesheet for each particular application. Thiswould allow an attribute, say the frame color, for all of theapplications to be automatically the same. If the developer wishes tochange the color of a particular application, he can modify thesub-class of that application's stylesheet and still maintain otherproperties mapped from a master sheet. The same pattern applies toscreens within an application or controls on a screen.

The mapping of each component to its ultimate style is actuallyperformed at provisioning time. The provisioning server creates a mastermap of all of the styles in use by an application and emits a set ofcondensed, non-inheriting style classes as part of the application. Thisexpansion conserves the amount of processing that must be done by thedeployed application on a recurring basis. This optimization is onlyeffective if the application's code remains constant through the life ofthe application. Since our model does allow additional application codeto be sent during the evolution of the process, the SimpleOS containerwill also contain logic to update stylesheets that use inheritance.

Table 55 shows an example of a more complex stylesheet.

TABLE 55 A Complex Stylesheet <sqml:stylesheet> <sqml:class id=“base”><sqml:palette> <sqml:colordef name=“white” rgb=“#ffff00”/><sqml:colordef name=“black” rgb=“#ffff00”/> <sqml:colordef name=“red”rgb=“#cc0000”/> <sqml:colordef name=“blue” rgb=“#4444ff”/><sqml:colordef name=“yellow” rgb=“#ffff00”/> </sqml:palette></sqml:class> <sqml:class super=“base” default=“true”> <sqml:bgcolorcolor=“white”/> <sqml:font typeface=“Helvetica” typesize=“12”typecolor=“black”/> </sqml:class> <sqml:class super=“base” id=“border”><sqml:bgcolor color=“blue”/> <sqml:font typeface=“Helvetica”typesize=“16” typecolor=“white” typestyle=“bold” /> </sqml:class></sqml:stylesheet>

As noted above, stylesheets provide the mechanism for managing screenlayouts on different devices. One of the properties that can becontained in a style is an area indicator that will give the exactwidth, height and location information for a particular GUI element.

X. Additional Features

Embedded Applications

SimpleOS is designed to allow a fully enabled implementation of thecontainer to communicate with embedded devices. For this purpose,embedded devices may include TV set top boxes, vending machines, homeappliances, car systems and other portal devices. There are a variety ofadaptations to the system that apply to embedded communication that arediscussed in the sections below.

Simple Embedded Protocols

Some embedded situations call for sending and receiving well-definedcodes between the device and a remote embedded system. These codes maybe transmitted using infrared, radio frequencies or a serial connection.Typically this type of communication uses a fixed vocabulary of signals.SimpleOS can accommodate this type of interaction in several ways. Oneoption is to provide a toolkit accessible using a limited nativeinterface from within SQScript. In this situation, Simple Quick GO, orsome other author, would provide a SQML interface to the communicationpathway required. Incoming messages to the SimpleOS-enabled device wouldbe directed to the message queue of the application and delivered via amessage descriptor. Outgoing messages would be posted by filling in atree-object as a request and posting it to the operating system using aprimitive within SQScript. If the pathway ends up being very common to aclass of users, Simple Quick GO may even add support for it directlyinto the operating system.

Code sets to control a remote device might include:

-   -   A vocabulary of IR codes to control a television;    -   A command set for an internal automotive control network;    -   Radio frequency mappings for a remote-controlled car; and    -   Diagnostic codes available from the OBC of a car engine        Network Protocols

In more advanced embedded applications, the two devices in question (theSimpleOS-enabled device and the remote device) form a network based onsome existing protocol. These scenarios might include PPP over IR,TCP/IP over WiFi, or TCP/IP over BLUETOOTH. In the case that thecommunication path is packet-based, a native plug-in may be created justas described in the previous section. In this case, the data packetsthat are sent and received are channeled to an application using codeadded into the operating system.

In the case where a streaming protocol is available, the approach ismuch less complex. In this case, SimpleOS can communicate directly withthe device using HTTP or HTTPS. This has proven to be very effective inembedded devices since a TCP/IP stack and web server can usually beimplemented in less than 4K of program code. In this situation, messagescan be passed to the web server using the same network communicationmodel used for server-side communication. If the embedded device canstream enough data, it is even possible that it can provision a newapplication to SimpleOS. In this case, the application would have tohave been completely pre-provisioned for the specific device type, andthe end application bundle signed and certified. The application wouldsimply appear to the embedded system as a stream that can be shippedover to SimpleOS.

Vending Machine Example

Using a simple wireless network and a streaming protocol could allow forsome very powerful results. Imagine a vending machine that allows a cellphone to connect to it to receive a menu and verify payment. Theexchange may operate as follows:

-   -   1) The user approaches the vending machine and enters the        wireless network managed by the vending machine's computer    -   2) During the polling of the new network, the launcher        application running inside SimpleOS discovers that there is a        provisioning source available on the local network. A message is        displayed to the user: “You are near a vending machine that can        be controlled from your cell phone. Would you like to connect?”    -   3) SimpleOS sends a message to the vending machine with its        device characteristics. The vending machine already has a set of        pre-provisioned, signed applications available to control it,        and it checks to see if the cell phones device type is listed        among the pre-provisioned images it has.        -   a. If the vending machine does have the correct image, it            streams it over to the cell-phone and provisions the            controller application        -   b. If the vending machine does not have the correct image,            it sends a URL to a provisioning server to the launcher            application. The launcher application can then download the            correct software.    -   4) The launcher application, having provisioned a new        application, asks the user: “You have just provisioned a new        application. Would you like to run it now?”    -   5) The application loads, and presents its user interface.    -   6) The user chooses an action such as “vend” inside the        application    -   7) The target of the message descriptor includes a variable that        causes the message to be marshaled as SQML and deployed to the        vending machine over the wireless network.    -   8) A simple HTTP engine on the vending machine parses apart the        message and performs the action.        SimpleOS to SimpleOS

Two SimpleOS devices can easily connect to each other and accomplish avariety of communication models. The simplest is when one SimpleOSinstance connects to another for peer-to-peer provisioning. If the twodevices have different device type signatures, this may require thereceiving instance to connect to a remote location to receive adevice-customized version of the application. Otherwise, theprovisioning will work securely because the certificate has beenembedded in the resource stream, guaranteeing to the receiver that theapplication has not been tampered with.

Two SimpleOS instances capable of exchanging messages can place items ineach other's queues. This is made possible by the fact that allapplication event messages are expressible as SQML. If an applicationrunning on one device knows the address of another device, it canformulate a SQML message using the standard remote messaging model anddeliver that message into the queue of the receiving application. Thismodel allows for several compelling uses of the technology. Forinstance, a TV set might itself run an instance of SimpleOS that haslinked into it commands to control the low level systems inside the TV.Any other SimpleOS device that can connect to the SimpleOS system insidethe TV can post messages to the TV without any additional developmentwork. The two operating systems speak the same language; so one of themcan serve as the adapter to a particular piece of hardware on behalf ofanother device.

Benefits and Features

The SimpleOS design presents a radically new way of organizing acomputer program, coupled with an innovative graphical user interfacedesign. Applications are freed from the need to understand how tomanipulate their outside environment. Instead, they update organizeddescriptions of their current state. The operating system does the workto determine the specifics of how to implement the request. By doing theheavy lifting for user interface and application logic, and creating asingle development language, the SimpleOS model offers easierdevelopment of widely deployable applications. Also, the powerfulnetwork features within SimpleOS greatly reduce the amount of work tomake an application network aware.

All of these factors become particularly important when considering thelimited abilities of most mobile operating systems such as J2ME andBREW, and the fact that code written in one environment is almostuseless on the other.

Streaming

Given the superstructure-based application environment of the invention,a system could be readily implemented (see FIG. 2) that would “stream”updates to the superstructure as a broadcast to multiple SimpleOSdevices at once. Such a system could utilize either (1) a means ofensuring that each device was in a consistent, known state at the timeof the transmission and that the transmission remains whole andcomplete; or (2) transmitting complete segments (each all or nothing) ofapplication update.

As shown in FIG. 2, a method in accord with this aspect of the inventionincludes broadcasting update data objects to devices, while ensuringcoherency (202); receiving, in the devices, the update data object(s)(204) and updating in accordance with the update data object (206). Notethat the updates could include updates to applications, data, or both.

Consider, for example, the example of a ballpark filled with baseballfans, many seeking dynamically updated information about scores fromother games, or pitcher/hitter statistics (how has this pitcher faredagainst the next batter in the past?). Using the streaming updatefeature, updates could be broadcast to thousands of SimpleOS-runningcellphones or other handheld devices at once, using either of the twonoted techniques (either a synchronization/coherency-insuring technique,or the transmissions of all-or-nothing segments of application update,so that users could receive real-time updates of an applicationdisplaying hitter/pitcher statistics and other information. Ifparticular fans do not have the necessary application on their handhelddevice, they could be queried as to whether they'd like to download theapplication (instantiation as a form of “update”) and the methodsdescribed herein could be used to instantiate the application, andsubsequent updates, into the handheld device.

These transmissions could use a data broadcasting method that couldminimize the need for individual point-to-point data transfers betweenthe update server and each client. The invention thus enables updatestreaming without the requirement of sending a multiplicity of differentmessages on a per-client basis for each update.

In each case, the update would be incorporated into the superstructureusing the superstructure modification/update techniques described in theearlier sections of this document. Because of the superstructure-basedapplication environment of the invention, the updates could beefficiently transmitted and processed across a wide range of differenthandheld devices within the stadium, regardless of the native operatingsystem of the various processors involved.

Streaming in this manner provides a number of advantages, including:

(1) less per-client state is required on the information server;

(2) the technique can exploit the network efficiencies of known or newmulticast/broadcast technologies, and reduce network traffic;

(3) it reduces the need for retransmission of failed packets (the nextbroadcast would overwrite them);

(4) it allows device transmitters to remain in “receive only” modeinstead of having to send back confirmation; and

(5) there is no need to maintain records of precisely which devices arestill receiving information, so devices are more free to leave andre-join the network without interruption to the communication protocolor the user experience.

Equalization

Mobile applications are typically divided into three areas: UserInterface Code: The look, feel and presentation of the application,Application Logic: The specific behaviors or features of theapplication, Communication Logic: The parts of the application thatcommunicate to the outside world to receive or send information.Depending on the platform, typical application development can focusgreater than 80% of the attention on user interface logic andcommunication. Many mobile operating environments are particularlyconstricted, and require highly specialized programmers to work verycarefully to create easy-to-use interfaces and manage communication.This is unfortunate since most of the core aspect of the application isnot present in either of these areas. Worse, the work done to solvethese problems on one platform can almost never be reused when portingto a different platform. Together, these issues increase testing anddevelopment time (and therefore, development cost). Given that themarket for wireless applications is still in its infancy, this acts as ahuge disincentive for developers.

The left-hand side of FIG. 20 shows the traditional application model(2002) that would commonly be applied to a mobile platform such asQUALCOMM'S BREW (Binary Runtime Environment for Wireless.). BREWsupports a very small subset of features for communication, datamanagement and graphical presentation. These features are presented tothe application programmer through a programming interface that requiresprocedure calls to set up and maintain hardware resources. Theapplication developer typically must perform additional work to tailorthe raw capabilities granted by the host environment into the specificlook and feel, communications model and data representation required forthe application. On top of this initial effort, the programmer adds thespecific logic or functionality that the application requires. Mostexisting platforms for application development generally follow thismodel.

The work done to shape an application's services on a particularsoftware environment typically cannot be re-used between environmentsdue to dissimilarities between different platforms. While the top-levelapplication logic can occasionally be reused between toolsets, this onlyapplies to platforms based on the same language such as C or JAVA.

In contrast, a SimpleOS product implemented in accordance with theinvention (2004) sits on top of each target operating system providingthe user interface, communication and data organization features.SimpleOS, controlled entirely by an application's XML structure,insulates the developer from the specific details of the platform.

This model extends well-beyond the “write-once, run anywhere” model ofJAVA. Because programs can be described in a lightweight form of XMLthat can run on a variety of hosts, SimpleOS makes it easy to deployapplications anywhere.

Networking Architectures

SimpleOS provides the ability for server-side processing to occur justas easily as it can on the device. The cornerstone of this feature isthat the networking protocol can ship over arbitrary sections of theapplication's superstructure over the network by converting it intoSQML. In essence, SimpleOS is sending application snippets instead ofdocuments or data when it communicates with the server.

This networking paradigm is the natural evolution of userinterface-to-server architectures. Originally, mainframe-computingsystems relied on a text-based user interface and communicated throughspecific screen elements. Client/Server architectures supported greateruser interface logic local to the device, but were still constrained bycommunication and desktop-specific programming rules. The web servicesmodel uses only one client browser, but all application logic mustreside on the remote server. SimpleOS provides for presentation andapplication logic to transparently reside on either the client orserver, providing a leap forward in application design. See 2108 of FIG.21, contrasted with 2102, 2104, and 2106.

Table 56 illustrates the differences in communication and dataparadigms.

TABLE 56 Comparison of Remote Computing Paradigms WWW Client/ (includingSimple Architecture Mainframe Server WAP) Quick Go Central Text RowDocuments Applications Communica- Terminals sets and tion ActionsParadigm Transport ASCII SQL HTML SQML Atoms Reliance on Extreme -High - High- Low- communica- without Client Medium - Medium - tionnetwork, is usually Browser can Applications client useless view havethe is dead without documents option to server offline, but spreadinteractivity interactivity is impossible between client and server, andapplications can be standalone Device None. Clients HTML/ None. SpecificProgrammers must be WML is SQML Programming just written general, offersdisplay to native but maximum ASCII platforms functional functionalversatility versatility is limited and and tied to client-device theserver. independence. Location of Server Server Server Client andapplication Server in any logic proportion Location of Server ServerServer Client or data Server as needed Description Server Server ServerClient or of user Server as interface needed handling

Yet another powerful advantage of the SimpleOS network model is that anapplication's code can be updated on the fly if so desired by thecarrier or the developer.

Platform Comparisons

The following sections compare SimpleOS to several existing technologiesto help illustrate the differences in the technology. SimpleOS vs. JAVASimpleOS and JAVA share many common goals. Both operating systems aredesigned to run as virtual containers over host operating systems likeWINDOWS or LINUX. Both operating systems allow for write-once,run-anywhere. Both provide a consistent platform-independent abstractionbetween their running applications and the native operating system. Bothare also highly network-aware, object-oriented and have support for XML.

The major difference between SimpleOS and JAVA is that JAVA does notsupport the novel execution model of SimpleOS described herein, whichfrees the programmer from concerns about how a particular description ofan application should be implemented, and allows a purely descriptivedevelopment model. In SimpleOS, the application need only describechanges. In contrast, within JAVA, the application must also perform thechanges. XML support within SimpleOS is automatic—any runningapplication can communicate in XML as easily as it communicates withitself. In contrast, JAVA requires marshalling and un-marshalling of XMLdata into private data structures. SimpleOS supports an intermediateform of application state that provides an additional level of securitybeyond the insulation provided by the JavaVM. In addition, SimpleOS'snetwork model allows for a seamless sharing of applications and databetween devices, because superstructure may be accessed and transferred.In a JAVA environment, this same effect would require explicit transfersof data and the programmer would need to identify when those transferswould be required, and write code specifically to handle them. It isexpected that SimpleOS code sizes would much smaller, because theapplication need not be concerned with support for a graphical userinterface library. Also, SimpleOS is designed to embed the entirety ofthe state assumptions between the application and the environment intothe superstructure. The same is not true for JAVA, which storesextensive private data within its class libraries, and even within thedevice-native portion of the virtual machine. A frozen JAVA program cannot consistently be restarted outside of its JAVA container. Theintroduction sections above, which describe other properties of theinvention, discuss other differences between opcode-based executionenvironments and SimpleOS.

SimpleOS vs. HTML

It may initially appear that HTML and SimpleOS have nothing in common,but the truth is that they share common roots. Both of them rely on acomplex data structure that is entirely descriptive; SimpleOS has thesuperstructure, and HTML has the DOM. However, HTML describes documents,where as SimpleOS's SQML describes applications. A SimpleOS applicationcan be completely client-side and does need to communicate with a remoteserver in order to be interactive.

At a technology level, both HTML and SimpleOS rely on an intermediateform to gain security, device-independence and stability. However, theHTML intermediate form is relatively fixed once it is downloaded into aweb browser, whereas the SimpleOS intermediate form (the superstructure)may change freely over time and is designed to allow such changes tooccur as a natural part of its execution. The entire operating“contract” and shared state assumptions between a SBAE engine and itsapplication code is explicitly expressed within the grammar and contentof the superstructure. SimpleOS does not consider the current runningapplication to simply be an XML grammar changing over time after it hasbeen seeded onto a browser, but instead, a rich, dynamic collection ofstate variables, structured data and program code that can easily bemarshaled back into a self-consistent package and transferred to anotherdevice. Values within the superstructure may refer directly toexpressions that evaluate within the context of the data being read.Additionally, the update mechanism used by SimpleOS works by directlydelivering events into the superstructure itself. The superstructure isthen free to modify itself in any way possible, as long as allmodifications are captured within the superstructure itself. Finally,the design of SimpleOS allows for an application's events and data to behandled seamlessly over a network, in part because the activation ofevent handlers and the data required to process them has beengeneralized. These differences, and others, arise as a result of theinherently different design foundation between HTML/DHTML, (optimizedfor documents), and SimpleOS (optimized for applications).

SimpleOS vs. XSLT

SimpleOS and XSLT share some characteristics in that they both usetemplate languages to effect change within trees. SimpleOS may even useXSLT in some of its early implementations because so much work hasalready been accomplished within XSLT in the area of tree manipulation.However, XSLT is almost entirely about producing final form grammars forincoming data. Typically an XSLT processor receives data in one form ofXML, and then transforms that data into a different XML grammar. InSimpleOS, the transformation always occurs within the same grammar(SQML). The output of the grammar does not leave the system, but insteadit gets reapplied to the original document. In this respect, SimpleOS'stransformation model can be a closed loop where as XSLT is almost alwaysan open loop.

It is to be understood that the invention described herein is amenableto a wide range of variations, modifications and alternativeconstructions and implementations. It should therefore also beunderstood that there is no intention to limit the invention to thespecific implementations described above. On the contrary, the inventionis intended to cover all modifications, alternative implementations andequivalents falling within the scope and spirit of the invention asdefined by the claims appended below.

Glossary of Terms Used in this Document

API: Application programmer interface. The means for a traditionalapplication to change its outside environment and communicates with theoperating system.

Class: A template that can be used to instantiate objects.

Clipped Tree: A form of a result tree that minimally describes a set ofchanges to an existing tree.

Data Member: A variable declared directly underneath an object or class.

Data Tree: The “data” section of an object, which can be an arbitrarySQML tree.

Dynamic Section: A portion of the superstructure that has shared meaningbetween the operating system and the application. When external eventsoccur, the operating system updates dynamic sections inside thesuperstructure and notifies the application. When the application wishesto change its environment, it updates the dynamic sections of thesuperstructure and the change is observed by the operating system.

Element Identifier Syntax for referring to an individual element withinan object.

Event Handler Code that handles an event.

Event Target: The location of code that is executed when an eventoccurs.

Host Operating System: The native operating system of a device, such asWINDOWS, JAVA or BREW. SimpleOS is written as an application or libraryfor a particular host operating system.

Initializer: A method within an object that is executed when the objectis instantiated.

Interpolated Expressions: An expression found in a string that isevaluated and replaced with the value of the expression.

Object: An instantiated object containing a data tree, methods and datamembers.

Result Tree: The output of a transformation-based SimpleOS messagehandler, which represents all or part of a new tree that must be appliedto the superstructure.

SimpleOS Container: An application that implements SimpleOS and providesa protected area for SimpleOS applications to run.

SimpleOS: A lightweight operating system from Simple Quick GO that runson a variety of environments such as WINDOWS, BREW, J2ME, and J2SE, etc.

SQML: An XML-based markup language used to describe applications andportions of applications for SimpleOS.

SQScript: A language written in SQML that can be used to express theapplication logic of a SimpleOS executable. The language is optimizedfor tree operations against the process's superstructure.

Stylesheet: A mapping between a display “class” and a set of low-levelattributes such as font, color and text size.

Superstructure: A central tree-like data structured maintained by eachrunning SimpleOS process that contains all of the state, code, data andregistrations for the entire application.

What is claimed is:
 1. A first provisioning system of a first party forprovisioning at least one mobile software application to a plurality ofremotely-located mobile computing devices, each of the plurality ofremotely-located mobile computing devices running a same device-nativemobile operating system associated with the first party, the firstprovisioning system comprising: a network interface operativelyconnected to a network, the network interface used by the firstprovisioning system of the first party at least in part forcommunicating with the plurality of remotely-located mobile computingdevices; non-transitory computer-readable storage medium configured tostore computer program code and the at least one mobile softwareapplication, wherein the at least one mobile software applicationcomprises an application bundle, wherein the application bundlecomprises: a. at least one signature created using at least one digitalcertificate associated at least with the first party, wherein saidsignature is used by a requesting mobile computing device among theplurality of remotely located mobile computing devices to verify thatthe requesting mobile computing device is authorized by the first partyto install the mobile software application, b. at least one abstractionlayer, c. at least one of an image, sound, graphic, animation, or video,d. computer program code comprising at least one of compiled code orinterpretable code, and e. at least one structured document comprisingat least one of a hypertext markup language (HTML) or an extensiblemarkup language (XML) structured document, such that the computerprogram code and the at least one structured document togetherinstantiate a tree structure used at least in part for expressing atleast a portion of the running state of the at least one mobile softwareapplication when the at least one mobile software application isexecuted using said same device-native mobile operating system of therequesting mobile computing device; at least one computer processoroperatively connected to the network interface and to the non-transitorycomputer-readable storage medium, the at least one computer processoradapted to execute the computer program code stored on thenon-transitory computer-readable storage medium such that the executionof the computer program code causes the first provisioning system toperform operations comprising: receiving a communication via the networkinterface from the requesting mobile computing device, the communicationcomprising a request to send the at least one mobile softwareapplication stored on the non-transitory computer-readable storage ofthe first provisioning system to the requesting mobile computing device;and sending, using the network interface of the first provisioningsystem, the requested mobile software application comprising theapplication bundle to the requesting mobile computing device, andfurther wherein the sent mobile software application will be executedusing said same device-native mobile operating system of the requestingmobile computing device.
 2. The first provisioning system of a firstparty of claim 1, wherein the requesting mobile computing device furthercomprises: a device network interface operatively connected to a networkand used at least in part to communicate with the first provisioningsystem of the first party; a display unit arranged to display anapplication user interface having at least one user selectable item; atleast one user interface for displaying information and receiving atleast one user selection; non-transitory computer-readable storagemedium configured to store said same device-native mobile operatingsystem and to store the at least one mobile software applicationcomprising the application bundle as received from the firstprovisioning system in response to a request for the at least one mobilesoftware application, the request sent using the device networkinterface from the requesting mobile computing device to the firstprovisioning system of the first party; at least one computer processoradapted for executing computer program code stored on non-transitory,computer-readable storage medium, the non-transitory, computer-readablestorage medium operatively connected to the at least one computerprocessor, such that when the computer processor executes at least aportion of said same device-native mobile operating system and when theat least one mobile software application is executed using the at leastone computer processor of the requesting mobile computing device, theexecution of the requested and received mobile software applicationcauses the requesting mobile computing device to perform operationscomprising: executing, by the requesting mobile computing device, the atleast one mobile software application received from the firstprovisioning system; populating a tree structure by the at least oneabstraction layer executing on the requesting mobile computing deviceusing at least one structured document; presenting at least a portion ofthe application user interface by the at least one abstraction layerusing at least a portion of said tree structure; receiving, by the atleast one mobile software application, an input from the at least aportion of the presented application user interface; receiving, by thecomputer code referenced by the at least one abstraction layer, datarepresentative of the input from the at least a portion of the presentedapplication user interface; reconfiguring at least a portion of the treestructure by the computer program code referenced by the at least oneabstraction layer, in response to receiving data representative of theinput from the at least a portion of the presented application userinterface; and updating at least a portion of the application userinterface by the at least one abstraction layer in response toreconfiguring at least a portion the tree structure.
 3. The firstprovisioning system of a first party of claim 2, wherein the at leastone abstraction layer is a scripting environment invoked by the computerprogram code and comprising at least one or more of: (a) at least onelibrary of components invoked through an application programminginterface, or (b) scripting language code.
 4. The first provisioningsystem of a first party of claim 3, wherein the native operating systemof the first party comprises a compiled scripting language engineinvoked by the abstraction layer.
 5. The first provisioning system of afirst party of claim 2, wherein the remotely-located mobile computingdevices are wireless mobile phones.
 6. The first provisioning system ofa first party of claim 2, wherein the application bundle includes atleast one message digest computed for at least some executable programcode comprising the application bundle and wherein the integrity of theat least some executable program code is verified by the mobilecomputing device using said message digest.
 7. The first provisioningsystem of a first party of claim 2, wherein the requested and receivedmobile software application, when executed on the requesting mobiledevice, causes at least a portion of the running state to be stored inat least one node of at least one tree structure.
 8. The firstprovisioning system of a first party of claim 1, wherein when therequested and sent mobile software application is executed by arequesting mobile computing device, the at least one structured documentis transformed into a tree structure which when updated, updates atleast a portion of the running state of the requested and sent mobilesoftware application.
 9. The first provisioning system of a first partyof claim 1, wherein the remotely-located mobile computing devices arewireless mobile phones.
 10. The first provisioning system of a firstparty of claim 1, wherein the communication from the requesting mobilecomputing device comprises data that identifies the requesting mobilecomputing device to the first provisioning system.
 11. The firstprovisioning system of a first party of claim 1, wherein the applicationbundle includes at least one message digest computed for at least someexecutable program code comprising the application bundle and whereinthe integrity of the at least some executable program code is verifiedby the mobile computing device using said message digest.
 12. The firstprovisioning system of a first party of claim 1, wherein the requestedmobile software application, when executed by the requesting mobiledevice, will cause at least a portion of the running state of theapplication to be stored in at least one node of at least one treestructure.
 13. The first provisioning system of a first party of claim1, wherein the running state comprises data enabling an application toresume execution after the application has been paused, halted, ormigrated.
 14. A method performed by a first provisioning system of afirst party for provisioning mobile software applications to a pluralityof remotely-located mobile computing devices, the mobile computingdevices each using a same device-native mobile operating systemassociated with the first party, the method comprising: receivingcommunications via a network interface of the first provisioning systemof the first party from a requesting one of the plurality ofremotely-located mobile computing devices, each mobile computing deviceusing said same device-native mobile operating system, thecommunications comprising a request to send a particular one of mobilesoftware applications stored on a non-transitory computer-readablestorage of the first provisioning system of the first party to therequesting one of the plurality of remotely-located mobile computingdevices, wherein the requested mobile software application comprises anapplication bundle, wherein the application bundle comprises: a. atleast one signature created using at least one digital certificateassociated at least with the first party, wherein said signature is usedby a requesting mobile computing device among the plurality of remotelylocated mobile computing devices to verify that the requesting mobilecomputing device is authorized by the first party to install the mobilesoftware application, b. at least one abstraction layer, c. at least oneof an image, sound, graphic, animation or video, d. computer programcode comprising at least one of compiled code or interpretable code, ande. at least one structured document comprising at least one of ahypertext markup language (HTML) or an extensible markup language (XML)structured document, such that the computer program code and the atleast one structured document together instantiate a tree structure usedat least in part for expressing at least a portion of the running stateof the requested mobile software application when the requested mobilesoftware application is executed using said same device-native mobileoperating system of the requesting one of the plurality ofremotely-located mobile computing devices; and sending, via the networkinterface of the first provisioning system, the requested mobilesoftware application comprising the application bundle to the requestingone of the plurality of remotely-located mobile computing devices,further wherein the sent mobile software application will be executedusing said same device-native mobile operating system of the requestingmobile computing device.
 15. The method of claim 14, wherein therequesting one of the plurality of remotely-located mobile computingdevices, when the requested mobile software application is executedusing said same device-native mobile operating system, performs a methodcomprising: executing, by the requesting mobile computing device, the atleast one mobile software application received from the firstprovisioning system; populating a tree structure by the at least oneabstraction layer executing on the requesting mobile computing deviceusing at least one structured document; presenting at least a portion ofthe application user interface by the at least one abstraction layerusing at least a portion of said tree structure; receiving, by the atleast one mobile software application, an input from the at least aportion of the presented application user interface; receiving, by thecomputer code reference by the at least one abstraction layer, datarepresentative of the input from the at least a portion of the presentedapplication user interface; reconfiguring at least a portion of the treestructure by the computer program code referenced by the at least oneabstraction layer, in response to receiving data representative of theinput from the at least a portion of the presented application userinterface; and updating at least a portion of the application userinterface by the at least one abstraction layer in response toreconfiguring at least a portion of the tree structure.
 16. The methodof claim 15, wherein the at least one abstraction layer is a scriptingenvironment comprising at least one or more of: (a) a compiled scriptinglanguage engine, (b) at least one library of components invoked throughan application programming interface, or (c) scripting language code.17. The method of claim 15, wherein the remotely-located mobilecomputing devices are wireless mobile phones.
 18. The method of claim15, wherein the application bundle includes at least one message digestcomputed for at least some executable program code comprising theapplication bundle and wherein the integrity of the at least someexecutable program code is verified by the mobile computing device usingsaid message digest.
 19. The first provisioning system of a first partyof claim 15, wherein the native operating system of the first partycomprises a compiled scripting language engine invoked by theabstraction layer.
 20. The method of claim 14, wherein when therequested and sent mobile software application is executed by arequesting mobile computing device, the at least one structured documentis transformed into a tree structure which when updated, updates atleast a portion of the running state of the mobile software application.21. The method of claim 14, wherein the application bundle includes atleast one message digest computed for at least some executable programcode comprising the application bundle and wherein the integrity of theat least some executable program code is verified by the mobilecomputing device using said message digest.
 22. The method of claim 14,wherein the remotely-located mobile computing devices are wirelessmobile phones.
 23. The method of claim 14, wherein the communicationsfrom the at least one remotely-located mobile computing device comprisesdata that identifies the requesting mobile computing device to the firstprovisioning system.
 24. The method of claim 14, wherein said signatureassociated with the first party is used by the requesting mobilecomputing device to verify that the requesting mobile computing deviceis authorized to execute the received mobile software application.
 25. Afirst provisioning system of a first party for provisioning mobilesoftware applications to a plurality of remotely-located mobilecomputing devices, the remotely-located mobile computing devices eachusing a same device-native mobile operating system associated with thefirst party, the first provisioning system comprising: network interfacemeans for communicating with the plurality of remotely-located mobilecomputing devices; non-transitory computer-readable storage medium meansfor storing computer program code and a mobile software application,wherein the mobile software application comprises an application bundle,wherein the application bundle comprises: a. at least one signaturecreated using at least one digital certificate associated at least withthe first party, wherein said signature is used by a requesting mobilecomputing device among the plurality of remotely located mobilecomputing devices to verify that the requesting mobile computing deviceis authorized by the first party to install the mobile softwareapplication, b. at least one abstraction layer, c. at least one of animage, sound, graphic, animation or video, d. computer program codecomprising at least one of compiled code or interpretable code, and e.at least one structured document comprising at least one of a hypertextmarkup language (HTML) or an extensible markup language (XML) structureddocument, such that the computer program code and the at least onestructured document together instantiate a tree structure used at leastin part for expressing at least a portion of the running state of themobile software application on the requesting one of the plurality ofremotely-located mobile computing devices when the mobile softwareapplication is executed by the requesting one of the plurality ofremotely-located mobile computing devices, each mobile computing deviceusing said same device-native mobile operating system; computerprocessor means for executing computer program code stored on thenon-transitory computer-readable storage medium means such that theexecution of the computer program code causes the first provisioningsystem to perform operations of: receiving communications via thenetwork interface means from a requesting one of the plurality ofremotely-located mobile computing devices, the communications comprisinga request to send a particular one of the mobile software applicationsstored on the non-transitory computer-readable storage means of thefirst provisioning system to the requesting one of the plurality ofremotely-located mobile computing devices; and sending, using thenetwork interface means, the requested mobile software applicationcomprising said application bundle to the requesting mobile computingdevice, wherein the sent mobile software application will be executedusing said same device-native mobile operating system of the requestingmobile computing device.
 26. The first provisioning system of claim 25,wherein the requesting one of the plurality of remotely-located mobilecomputing devices that requested and received the requested mobilesoftware application comprising said application bundle from the firstprovisioning system, comprises: network interface means forcommunicating with the first provisioning system; display unit means fordisplaying an application user interface; user interface means forreceiving at least one user selection; non-transitory computer-readablestorage medium means for storing said same device-native mobileoperating system and the at least one mobile software applicationcomprising the application bundle received from the first provisioningsystem in response to a request for the mobile software application, therequest sent using the network interface means from the requesting oneof the plurality of mobile computing devices to the first provisioningsystem; computer processor means for executing computer program codestored on the non-transitory computer-readable storage medium means,such that execution of the requested and received mobile softwareapplication causes the requesting mobile computing device to performoperations comprising: executing, by the requesting mobile computingdevice, the at least one mobile software application received from thefirst provisioning system; populating a tree structure by the at leastone abstraction layer executing on the requesting mobile computingdevice using at least one structured document; presenting at least aportion of the application user interface by the at least oneabstraction layer using at least a portion of said tree structure;receiving, by the at least one mobile software application, an inputfrom the at least a portion of the presented application user interface;receiving, by the computer code referenced by the at least oneabstraction layer, data representative of the input from the at least aportion of the presented application user interface; reconfiguring atleast a portion of the tree structure by the computer program codereferenced by the at least one abstraction layer, in response toreceiving data representative of the input from the at least a portionof the presented application user interface; and updating at least aportion of the application user interface by the at least oneabstraction layer in response to reconfiguring at least a portion of thetree structure.
 27. The first provisioning system of a first party ofclaim 26, wherein the at least one abstraction layer is a scriptingenvironment comprising at least one or more of: (a) a compiled scriptinglanguage engine, (b) at least one library of components invoked throughan application programming interface, or (c) scripting language code.28. The first provisioning system of a first party of claim 27, whereinthe native operating system of the first party comprises a compiledscripting language engine invoked by the abstraction layer.
 29. Thefirst provisioning system of a first party of claim 26, wherein therunning state comprises data enabling an application to resume executionafter the application has been paused, halted, or migrated.
 30. Thefirst provisioning system of a first party of claim 25, wherein thesignature associated with the first party is used by the requestingmobile computing device to verify that the requesting mobile computingdevice is authorized to execute the received mobile softwareapplication.